title: Capture a dot with postgres regexp
body: <p>I have these strings :  </p>
  
  <pre><code>3           FD160497.   2016  abcd
  3           FD160497   2016  abcd
  </code></pre>
  
  <p>I want to capture "FD", the digits, then the dot if it is present.</p>
  
  <p>I tried this :</p>
  
  <pre><code>SELECT
      sqn[1] AS letters,
      sqn[2] AS digits,
      sqn[3] AS dot
  FROM (
      SELECT
          regexp_matches(string, '.*?(FD)([0-9]{6})(\.)?.*') as sqn
      FROM
          mytable
  ) t;
  </code></pre>
  
  <p>(PostgreSQL 9.5.3)</p>
  
  <p>"dot" column is <code>NULL</code> in both cases, and I really don't know why.
  It works well on <a href="https://regex101.com/r/p5SCfm/1" rel="nofollow noreferrer">regex101</a>.</p>