0

I have used regex to find number from a given string.My code is working fine for the most of the scenario.

But, Here is an example where i am facing issue.

String : EU/EEA6123645789133113 this is the string from where i want to find number.

Pattern :[6][0-9]{9} - which means that number should start with 6 and the length of the character will be 10. https://regex101.com/

Output is : 6123645789 , which is correct.

But in the same string u can see there is another number which start with 6 and length is 10.

String : EU/EEA6123645789133113

String : EU/EEA6123645789133113

I want to fetch both the numbers 6123645789 and 6457891331.

Can anyone suggest any solution?

0 Answers0