-2

I need to search for all strings like this "264676343" in sublime text editor, 9 numbers between "". I try to use this "0-9" but not work... please help me.

Alan Moore
  • 68,531
  • 11
  • 88
  • 149
  • Possible duplicate of http://stackoverflow.com/questions/3968049/regex-allow-a-string-to-only-contain-numbers-0-9-and-limit-length-to-45 – MattDMo Sep 18 '16 at 12:04

1 Answers1

2

the 0-9 searches for digits. That is good. But you need to find a sequence of digits, so:

[0-9]+ take a look: https://regex101.com/r/yJ2rA8/1

and if you want to have EXACTLY 9 digits, then this should do the trick:

[0-9]{9} take a look: https://regex101.com/r/aC7oF9/2

As per MattDMo comment, you may also use a shorthand for digits \d instead of 0-9:

\d{9}
\d+
Unamata Sanatarai
  • 5,609
  • 3
  • 22
  • 46