I want to create a Regex template that matches all relative patches.
What I want to combine:
img src = "image.png"
img src = "http_image.png"
What I do not want to match:
img src = "http: //example/image.png"
I tried matching with these patterns, but none of them work:
\ src = "[^ http: //] \
\ src = "^ (http: //) \
\ src = "[^ h] [^ t] [^ t] [^ p] [^:] [^ /] [^ /] \
\ src = "([^ h] [^ t] [^ t] [^ p] [^:] [^ /] [^ /]) \
I pulled <> from the img tag, because otherwise I could not write it as code.
The src attribute will always be formatted with double quotes ("), not single quotes (').
It will always contain the source" http ", not" https "or others.
source
share