Regular Expression To Match Forward Slash

Forward slash (/), usually appears at the end of URLs. It is a way to divide up long addresses, helping to create a more user-friendly URL. Also, it is used in the command line and search queries.

This is a Regular Expression that simply matches all forward slashes found in a string.



  • \/ Escaped character. Matches a “/” character.


  • /
  • //
  • ///


  • abc
  • 123
  • \\\

See Also: