The problem is
The same format is repeated three times
Only one should be removed in the middle.
Attach the example text below
TEST.txt (2.9 KB)
I need to remove the yellow mark
I kept thinking about how to express it in a regular expression, but there was no answer.
\d{4}/\d{2}/\d{2}
If I use regex above
It’s even chosen that I don’t have to delete
So what I came up with is
\d{3}-\w*\s\d{4}/\d{2}/\d{2}
In this regex
Can we make it selected except for this?
\d{3}-\w*\s
Then I think only the yellow mark that I want to delete will be left.
Hi
Can you please explain your problem further?
We have a sample, but can you please show:
the expected output
bold the text you want to remove
This will assist greatly and you will have an answer faster!
Cheers
Steve
adiijaiin
(Aditya Jain)
August 24, 2023, 6:03am
3
hi @sssim4567
So you want to remove these dates that are being highlighted?
If so you have half the solution with you, once you get the matched dates in an array
Use this Regex: \d{3}-[a-zA-Z0-9]{2,}\s\d{4}/\d{2}/\d{2} or [0-9]{3}-[a-zA-Z0-9]{2,}\s\S *
You get an Array of matches, then loop through this array and
Use another regex : \d{4}/\d{2}/\d{2} on each one of item to get just the dates and replace that date text with strData.Replace(dateRegexArrayitem,“”)
Here strData has the text from you txt file.
Happy AutomatioN!
Hello
If you simply want to remove the dates from the end of each line then you can use this Regex Pattern:
(?<=\d{3}-\w*\s)\d{4}\/\d+\/\d+
Cheers
Steve
further.txt (2.8 KB)
The attached example above has been deleted by hand.
a recurring rule
year4/month2/day 000-xx year4/month2/day2
in Here
I want to delete the last year4/month2/day2
If I express “year4/month2/day2” as a regular expression
It’s as below
\d{4}/\d{2}/\d{2}
However, if I use this expression, I will be selected anywhere else I don’t want to delete.
I want a regular expression that allows me to select only the parts I want to delete.
Thanks for the followup /results sample.
All the best with your project.
Cheers
Steve
system
(system)
Closed
August 27, 2023, 6:14am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.