i've this url
https://www.mirrored.to/files/12345678/abcdefgh
and I need to change this replace the / with space before the a alphabet 2 Space
https://www.mirrored.to/files/12345678 abcdefgh
/(?!.*/)
# 2 spacesExplanation:
/ # a slash
(?!.*/) # negative lookahead, make sure we haven't another slash after
Screenshot (before):
Screenshot (after):
Lets say you have your single URL or some more in a text file line by line
https://www.mirrored.to/files/12345678/abcdefgh
https://superuser.com/questions/1807813/insert-a-space-in-line-after-notepad
https://stackoverflow.com/questions/76245266/adding-characters-to-the-first
https://www.mirrored.to/files/12345678/ABCDEFGH
you'd go through following steps:
^(.+\d)(\/)(.+$)
$1 $3
Explanation:
^ asserts position at start of a line
1st Capturing Group (.+\d)
. # matches any character (except for line terminators)
+ # matches the previous token between one and unlimited times
\d # matches a digit (equivalent to [0-9])
2nd Capturing Group (\/)
\/ # matches the character /
3rd Capturing Group (.+$)
. # matches any character (except for line terminators)
+ # matches the previous token between one and unlimited times
$ # asserts position at the end of a line
Screenshot (before):
Screenshot (after):
/
by one space or two spaces? Edit your question and improve formatting for better reading. e.g. four blanks at beginning of text (code) lines.