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 minThough 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!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login