(?<=<link\s+.*?)href\s*=\s*[\'\"][^\'\"]+
works with Expresso (I think Expresso works in the .NET regex-engine). You can even improve this a little more to fit the closure 'or
":
(?<=<link\s+.*?)href\s*=\s*([\'\"])[^\'\"]+(\1)
Your regex-engine may not work with lookbehind statements. The workaround would be
(?:<link\s+.*?)(href\s*=\s*([\'\"])[^\'\"]+(\2))
Your match will be in captured group 1.
source
share