how to extract 2 numbers from below mentioned string?
Input:
12345666666666789302
8676866786867686766252536123F
Ideal output:
1st number: Ending with 302
2nd number: ending with 123F
how to extract 2 numbers from below mentioned string?
Input:
12345666666666789302
8676866786867686766252536123F
Ideal output:
1st number: Ending with 302
2nd number: ending with 123F
Hi @anjasing
Check the below regular expressions,
\d+(302)

\d+(123F)

Check the below workflow for better understanding,
- Assign -> Input = "12345666666666789302
8676866786867686766252536123F"
- Assign -> Number1 = System.Text.RegularExpressions.Regex.Match(Input.toString,"\d+(302)").Value
- Assign -> Number2 = System.Text.RegularExpressions.Regex.Match(Input.toString,"\d+(123F)").Value
Hope it helps!!
Hey @anjasing
you can try use this:
System.Text.RegularExpressions.Regex.Match(yourInputStringVariable, "\d*302\b").Value
System.Text.RegularExpressions.Regex.Match(yourSecondInputStringVariable, "\d*123F\b").Value
Hi @anjasing
You can use this Regex phrase below for your examples or for any other strings which you want to extract the last 3 numbers and the last letter in the string.
(\d{3})\D*$

I hope this helps you, happy automation ![]()
Thank you so much ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.