I'm trying to rewrite some text that contains URLs such as:
"/route/id"
"/base/route/id"
"/route2/id"
"/base/route2/id"
of which there will be many in the text. The quotes are part of the text being matched.
All these URLs need to be of the format "/base/..." so I need to rewrite "/ to "/base/ unless the "/base is already there. Which is the bit I'm struggling with. I can replace the "/ but not when it's already followed by base.