regex to extract a specific set of numbers
Status: Closed · Asked by aristosv on · 0 views
I need a regular expression to extract a specific set of numbers from a string. The string could contain letters, special characters and spaces.
Input examples:
This is a test 99 12 3456
This is test 2 94123456
This is test 3 357 95123456
This is test 4 35797123 456
And so on…The regex should look for a string of at least 8 or 11 numbers starting with 357 or 94 or 95 or 96 or 97 or 99, followed by 6 or 8 more numbers.
Eventually the correct string output will be one of the following (without the <>):
94<6 more numbers here>
95<6 more numbers here>
96<6 more numbers here>
97<6 more numbers here>
99<6 more numbers here>
35794<6 more numbers here>
35795<6 more numbers here>
35796<6 more numbers here>
35797<6 more numbers here>
35799<6 more numbers here>
Thanks for your help
Hey @aristosv
Pabbly Connect has an action called "Text Formatter by Pabbly: Extract Pattern" to extract the pattern on the basis of given Regex as shown below. You can consider using this for your case -

I have tried at my end but, couldn't provide you with the exact pattern. I would recommend you checking the below links for generating the desired Regex and use it in the above action step.