How do use RegEx Matches and Replace

Hi All

Need your advice. I am trying to extract data from email.

Gross Salary (A) 8000

How do I use RegEx (Match and replace) to obtain 8000?

1 Like

@afinity_lim
Welcome to the forum

find starter help here:
Demo_Replace_Activity-Api.xaml (5.8 KB)

for a replace it is mandatory to specify the replace value, so I implemented with empty string for demo purpose.

Retrieving the value we would use the Match Activity or the Api as below
grafik

Ensure following:
grafik

And have a look here as well:

4 Likes

hi @afinity_lim

Welcome to Community .You can use below regex to capture the amount .

REGEX :-

(?<=Gross Salary \WA\W )\d*(?=\s)

This regex will help to find Gross Salary (A) first and then after matching the test it will fetch next integers value i.e 8000 in above example after Gross Salary (A).

please find below xaml file for same .
Main.xaml (5.1 KB)

Hope this help your problem statement .

1 Like

Hi @afinity_lim

Just have a look to the below regex :-
image

Output :-
image

Group1 is your output

https://regex101.com/r/a9t5mL/3

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:

2 Likes

Hi All

Thanks for your advice and guidance…

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