Asanka
August 4, 2020, 1:10pm
1
Hello, Can someone help with with a regex to capture the text above the word “OR”? However, I also do not want the top line. Here is an example:
What to do in the morning:
Get out of Bed
OR
Stay in bed
I want to capture 1) Get out of Bed. But I do not want “What to do in the morning”
RobertD
(Docan Robert)
August 4, 2020, 1:13pm
2
Please see if the sentence you’re looking for is always right behind OR
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
Asanka
August 4, 2020, 1:16pm
3
It is always behind OR on a new line which is above
@Asanka Check the regex in the link :
Try it for all possible data that you have, if it doesn’t work for some data, post a sample of that data, so that we can try to give you a more robust solution.
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
1 Like
Srini84
(Srinivas Kadamati)
August 4, 2020, 4:00pm
5
@Asanka
Check as below
Mark as solution if this helps
Thanks
2 Likes
system
(system)
Closed
August 7, 2020, 4:00pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.