I wrote this regex to match all href
and src
links in an HTML page; (I know I should be using a parser; this just experimenting):
/((href|src)\=\").*?\"/
# Without look-behind
It works fine, but when I try to modify the first portion of the expression as a look-behind pattern:
/(?<=(href|src)\=\").*?\"/
# With look-behind
It throws an error stating 'invalid look-behind pattern'. Any ideas, whats going wrong with the look-behind?