• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

regex to extract a specific set of numbers

aristosv

Member
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:

Code:
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 <>):

Code:
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
 

Supreme

Well-known member
Staff member
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 -

1648884954350.png


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.


 
Top