Need help for Regex pattern - 5/Jun

My input file :
My DOB : 01/05/89 at Chennai
I am an IT professional working in Southern India.
My DOJ : 20/04/24 at Bengaluru, Karnataka
My recruitment happened through campus hire program.
I will be working on UiPath and Dot net related projects.

Can you please me on how to extract location as Bengaluru, Karnataka.

Can you help me with single regex statement → Start keyword as IT and End keyword as recruitment

Hi @Avinesh_Ramanathan

Try this Regex:

(?<=IT[\s\S]*?\d+\/\d+\/\d+\s*[a-z]+\s+).*(?=\s.*recruitment)

Regards

https://www.google.com/search?q=regex+string+between+two+words

(?<=My DOJ : [0-9][0-9]\/[0-9][0-9]\/[0-9][0-9] at )(.*)

image

Can you help me with the regex on the above input string please

Will your date pattern change everytime @Avinesh_Ramanathan

Regards

not everytime, below is the correct input string.

My DOB : 01/05/89 at Chennai
I am an IT professional working in Southern India.
My DOJ : April 20, 2024 at Bengaluru, Karnataka
My recruitment happened through campus hire program.
I will be working on UiPath and Dot net related projects.

Can you please me on how to extract location as Bengaluru, Karnataka.

Can you help me with single regex statement → Start keyword as IT and End keyword as recruitment

Hi @Avinesh_Ramanathan

Check this:

(?<=IT[\s\S]*?(\d+\/\d+\/\d+|[A-Za-z]+\s*\d+\,\s*\d+)\s*[a-z]+\s+).*(?=\s.*recruitment)

The above regex will work for the two inputs that you have provided.

Regards

HI @Avinesh_Ramanathan

You can use the below syntax also:

(?<=IT[\s\S]*?)([A-Z][a-z]+[, ]+[A-Z][a-z]+)(?=\s+.*recruitment)

Xaml:
Sequence12.xaml (8.0 KB)

Regards

Can you please help me with one more regex pattern for the above to extract Bengaluru, Karnataka

Hi @Avinesh_Ramanathan

(?<=IT[\s\S]*?)([A-Z][a-z]+[, ]+[A-Z][a-z]+)(?=\s+.*recruitment)

Regards

Thank you so much. It worked…

Please help me how to learn regex patterns as i m beginner on it…

HI @Avinesh_Ramanathan

You’re Welcome.

You can learn regex from below videos:

Happy Automation!!

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