Regex to extract numers

andrea93

Member
Hello to all,
I use this regex to extract a number:
(? <OnlyNumbers> [\ d] +)

the problem is that if I have this string:

Hi I have 2 numbers, but I only use 345935945

extracts the first number, but I don't need it.

Do you have any ideas for integrating my regex to exclude numbers below a certain length?
 

gil.silva

Active Member
Hello andrea93,
You can use \d{5,} meaning that you only match numbers with 5 or more digits!
You can also use \d{8,10}, meaning that you only match numbers with 8, 9 or 10 digits
 
Top