I have a problem with a difficult regex. I have this expression to detect absolute urls (http and https
/(url {0,}\(( {0,}'| {0,}"|))(?!http|data\:).*?\)/im
What I want to do basically is with preg_replace
to prepend the url with a path $path
defined in my script. Basically this regex results in two capture groups:
group 1: (url {0,}\(( {0,}'| {0,}"|))(?!http).*?\)
group 2: ( {0,}'| {0,}"|)
How can I match all the way until the uri starts and then prepend it with $path
? I can't seem to get the capturing groups right.