title: SQL Regex to select string between second and third forward slash
body: <p>I am using Postgres/Redshift to query a table of URLs and am trying to use 
  <code>SELECT regex_substr</code> to select a string that is between the second and third forward slash in the column.</p>
  
  <p>For example I need the second slash delimited string in the following data:</p>
  
  <pre><code>/abc/required_string/5856365/
  /abc/required_string/2/
  /abc/required_string/l-en/
  /abc/required_string/l-en/
  </code></pre>
  
  <p>Following some of the regexs in this <a href="https://stackoverflow.com/questions/16825979/regex-to-find-text-between-second-and-third-slashes">this thread</a>:</p>
  
  <pre><code>SELECT regexp_substr(column, '/[^/]*/([^/]*)/')
  FROM table
  </code></pre>
  
  <p>None seem to work. I keep getting: </p>
  
  <pre><code>/abc/required_string/
  /abc/required_string/
  </code></pre>