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.
/\//ig
Explain:
\/Escaped character. Matches a “/” character.
Matches:
- /
- //
- ///
Non-matches:
- abc
- 123
- \\\
See Also:
- Regex To Match Strings After The Last Slash In A String
- Regex To Matche A Slash At The End Of A String