Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to get the regex-pattern for the following sequence of numbers:


Every X is one number.

How can I do that? I don't want to use *, because I need exactly the number of numbers.

share|improve this question
up vote 2 down vote accepted

Use braces to specify the number of occurrences:


{3} will match the previous token exactly 3 times. You can also specify a range like {1,5} which will match the previous token between 1 and 5 times. This is a greedy match and will match as many characters as possible.

share|improve this answer
Thank you. It worked – Christian Woerz Nov 6 '13 at 10:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.