Skip to content

Instantly share code, notes, and snippets.

@Anakin-Hao
Last active January 7, 2019 01:49
Show Gist options
  • Save Anakin-Hao/a341f923c0dd803ee7ada2d65167296e to your computer and use it in GitHub Desktop.
Save Anakin-Hao/a341f923c0dd803ee7ada2d65167296e to your computer and use it in GitHub Desktop.
Regex match url /path
(?:\/\/[^\/]+\/)([^\/]+)(?:\/*.*)
https://www.ruby-forum.com/tasdas_asd/validate-client-certificate-sdn-fields-cn-ou-o-etc-at-nginx/233221
$1 return tasdas_asd
Or (?:\/)([^\/]+)(?:\/*.*)
/tasdas_asd/validate-client-certificate-sdn-fields-cn-ou-o-etc-at-nginx/233221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment