Hello,
I need to extract the value between 2 fixed strings, but the problem si one of them may appear multiple times.
“RING” is the word that may appear multiple times and “Ending” is the fixed string.
For example, this is my text:
RING
confidential 123
200 is the price
RING
$2000
RING
I want to buy something else
Right now
Ending
I need that the value extracted to be: “I want to buy something else Right now”
Thanks in advance!
vrdabberu
(Varunraj Dabberu)
2
hi @darie.leolea
Use the below regex expression:
(?<=RING\s*.*\d+\s*RING)([\s\S]*?)(?=\s*Ending)
Regards
vrdabberu
(Varunraj Dabberu)
3
Hello @darie.leolea
Try this Regex pattern - note your target text is the 1st Regex Group. Not the full match.
Let your input text be ‘yourStr’ and then use an Assign activity like this:
Left:
Str_Result
Right:
System.Text.RegularExpressions.Regex.Match(yourStr, “RING[\s\S]+RING([\s\S]+(?=Ending))”).Groups(1).ToString
You can learn Regex using my Megapost
Cheers
Steve
system
(system)
Closed
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.