-1

I have a list of urls

Some have traling slashes

some do not have traling slashes

I need to remove all trailing slashes IF they exist urls look like this:

https://123.com/@boakye2015/

https://123.com/@boakye2015

please supply the regex to find and replace

Athia
  • 17
  • 9

1 Answers1

0

Give this a try and replace with: \1\2

(http\S+)\/(\s|$)

(...) first group captures to \1, second to \2

\S matches character that is not whitespace, \s whitespace, $ the end.