title: Java REGEX to match an exact number of digits in a string
body: <p>I tried to find the answer to my problem in the questions history but they just come back in more than one thousand and after scanning through a few tens of matching answers I gave up.
  So here is my problem.</p>
  
  <p>I want to be able to find the first sequence of exactly six digits in a string.
  Given the string
  “Some text 987654321 and some more text 123456 and some other text again 654321 and more text in the end”
  I want to find the regex that will match the 123456 sequence.</p>
  
  <p>I am new to regex and a short explanation about how it works will help a lot.</p>
  
  <p>Thank you in advance</p>