c# - Find href attribute values that do not contain “javascript:” -


I have a RegEx that finds a href well in a URL:

  & Lt; [Aa] [^ & gt;] *? Href = [\ "'] (? & Lt; url & gt; [^ \"] +?) [\ "'] [^ & Gt;] *? & Gt;  

However, I want it to not get any ARR that contains the text, 'javascript:'.

The reason for this is that sometimes I have to improve the href and sometimes it does not When there is a Javascript: Text in the ARF I want it not found by regex.

(ASP.NET, C #)

I really do not recommend using a regexp for this Because HTML is not regular and there is no end to completing the side cases. If possible, please use the HTML parser, it seems that you will get very little sorrow.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -