I need to find all tags <link />in html that are not commented out.
For example, in html:
<link rel="stylesheet" href="xyz/dzgt/style.css" />
I need a regular expression <link rel="stylesheet" href="xyz/dzgt/style.css"/>, but not appropriate <link rel="stylesheet" type="text/css" href="xyz/dzgt/ie7.css" />, because it is surrounded <!-- -->.
I could find all the tags <link />with the following regex /<link.*href="(.*\.css)".*\/>/m, but it also matches the comments, but I only need those that are not commented.
Thanks for the help in advance!
source
share