Finding a value in one line and prepending it to the next line
-
Hi, I would like to do a find in one line and then prepend that value to a line right after that line.
I’ve found this regex
Find (my value) [\r\n]+([^\r\n]+)
Replace \r00:05 min \1The challenge is the value I’m trying to find “00:05” is in a time stamp in the form 00:05:05:001
When I use find and replace with only using as in 05[\r\n]+([^\r\n]+) it works, but returns too many values. When I use the full value I need to find 00:05: 00:05:[\r\n]+([^\r\n]+)it returns no values found. I’m guessing the : with the regex messes up the find.
Can you see where my error is?
Thanks
Below is some more detail if that helps.
Here is a sample of the text I am searching
110
00:04:59.335 --> 00:05:01.725
So, welcome to this video111
00:05:01.825 --> 00:05:05.525
If you have any questionsSo the regex would find the 00:05 in the first timestamp and then prepend it to the next line. Note: the first 00:05 could also be in the beginning of the line.
110
00:04:59.335 --> 00:05:01.725
00:05 min So, welcome to this videoThanks Again
-
@MaximillianM said in Finding a value in one line and prepending it to the next line:
00:05:[\r\n]+([^\r\n]+)
You want:
Find what:
(00:05:[^\r\n]+[\r\n]+)
Replace with:\100:05 min
Though you can’t see it here, there is a space after
min
. -
@Coises said in Finding a value in one line and prepending it to the next line:
(00:05:[^\r\n]+[\r\n]+)
Thanks so much!