Get the data in between the strings

I have a string

No.: 366173459
issued: July/14/2011
expires: July/13/2021

I need to extract the number 9309124F2107131476790629 which is in between USA and < sign.

Please help.


@divya.chopra In the data there are two matches that match the pattern that you are looking for. Do you always want the last occurrence of that pattern? Will the data that you want be always present in the last?

Hi @divya.chopra

Just asking Some Que before the solution

  1. Is your below text is in Single line or seperate line ?? :-

  2. The Number you want to Extract gonna be of same length ??

If both of the above que’s answers are “YES” then below is the regex for the same in 2 ways :-

Way 1 :-


Way 2 :-


Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Yes the data was always be present in the last

@divya.chopra Check this Workflow : (1.5 KB)

It uses the Regex Option RightToLeft which takes the matching values from the Last Match.
Check the workflow with different Inputs that you have.

Check this Link. You can verify your data in here as well. Although the regex matches two Strings the Last Match is returned as the Output.

1 Like

thanks it worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.