Need to get data in between Highlighted roundup in below screenshot with Regex
can any one help
Thanks
shaik
Need to get data in between Highlighted roundup in below screenshot with Regex
can any one help
Thanks
shaik
one thing you can do , you can use the regex as key value pair , eg. in your case first search “Routing this section is applicable …” and then find the poistion of the text and then search the second text “Does number…” by this you can find in that these text are in the string then you can get the length of the string and then you can get the text in b/w these two patterns by using substring. another way is use Regex replace , replace both the strings “Routing " and “Does” with Space and the remaining text is your desired text.(first copy the whole text in a another string variable eg. strTemp and perform Regex replace on the temp one”
you can use this System.Text.RegularExpressions.Regex.Replace(yourTextInWhichYouReplace,patternToFind,ReplaceWith)
strString = yourWholeString;
String strTemp=strString;
string pattern_1= @“Routing This section is applicable …”
string pattern_2= @“Does Number…”
eg. strTemp=System.Text.RegularExpressions.Regex.Replace(strTemp,pattern_1,String.Empty);
strTemp=System.Text.RegularExpressions.Regex.Replace(strTemp,pattern_2,String.Empty);
Now the strTemp is the Remianing text
The regular expression to capture the first two lines and the last line is:
^(.*\n.*\n).*?(\n.*)$
^(.*\n.*\n)
^
matches the start of the string..*\n
matches any characters until the first newline, repeated for two lines..*?
(\n.*)$
$
ensures it matches until the end of the string.Use this pattern in your desired tool or environment.
copy paste the text. Not screenshot.
Hi,
How about the following pattern?
(?<=4 Routing\s+.*\n)[\s\S]+?(?=Does Number Portability Apply)
Regards,
please take this text file
https://forum.uipath.com/uploads/short-url/f94JGHBBBo0q71vrGITiDHf37s2.txt
thanks
shaik
@Yoichi can you add "This section is applicable for " also in regex
thanks
shaik
Hi,
Can you try the following?
(?<=\n4 Routing\s+This section is applicable for.*\n)[\s\S]+?(?=Does Number Portability Apply)
Regards,
@Yoichi let me try, will confirm
thanks
shaik
(?<=This section is applicable for FRAFI)([\S\s]*)(?=Does Number Portability Apply?)
I need to get before two lines and last one line also
Before two lines :
4 Routing
This section is applicable for
Last line:
Does Number Portability also
Please help
thanks
shaik
Hi,
How about the following?
(?<=^|\n)4 Routing\s+This section is applicable for[\s\S]+?Does Number Portability Apply.*
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.