title: Php lookahead assertion at the end of the regex
body: <p>I want to write a regex with assertions to extract the number 55 from string <code>unknownstring/55.1</code>, here is my regex</p>
  
  <pre><code>    $str = 'unknownstring/55.1';
      preg_match('/(?&lt;=\/)\d+(?=\.1)$/', $str, $match);
  </code></pre>
  
  <p>so, basically I am trying to say give me the number that comes after slash, and is followed by a dot and number 1, and after that there are no characters. But it does not match the regex. I just tried to remove the <code>$</code> sign from the end and it matched. But that condition is essential, as I need that to be the end of the string, because the <code>unknownstring</code> part can contain similar text, e.g. <code>unknow/545.1nstring/55.1</code>. Perhaps I can use preg_match_all, and take the last match, but I want understand why the first regex does not work, where is my mistake.</p>
  
  <p>Thanks</p>