title: How can I write a regex to find only numbers with four digits?
body: <p>I am trying to write a regex in Ruby to search a string for numbers of only four digits. I am using<br>
  <code>/\d{4}/</code> but this is giving me number with four and more digits.</p>
  
  <p>Eg: "<code>12345-456-6575 some text  9897</code>"</p>
  
  <p>In this case I want only <code>9897</code> and <code>6575</code> but I am also getting <code>1234</code> which has a length of five characters. </p>