in reply to Regex for replacement

s!^.*(/[^/]+/main)!$newtext$1!

Note, I used '!' as the quoting delimiter to avoid the need for escaped slashes.


Dave