0

This one is probably easy, but cant figure it out, I want to replace <BR> with newline and add https:// behind example.com

example:

https://www.google.com<BR>example.com

would become:

https://www.google.com
https://example.com

I tried using sed but probably messed up.

sed 's/<BR>/\n/g'

which replaces <BR> with newline, but cant figure out how to add https://

2

Use alternative delimiters

sed 's=<BR>=\nhttps://='

or backslash the slashes

sed 's/<BR>/\nhttps:\/\//'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.