Skip to content

Instantly share code, notes, and snippets.

@muhrusdi
Created July 11, 2022 15:54
Show Gist options
  • Save muhrusdi/d46489cc9a38d7c6316e75ae1db78777 to your computer and use it in GitHub Desktop.
Save muhrusdi/d46489cc9a38d7c6316e75ae1db78777 to your computer and use it in GitHub Desktop.
Get first/second slash
^\/[^/]+\/([^/]*) -> "/path/path2/path3/path4" -> ["/path/path2"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment