Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Really need help matching stylesheet links in html

  •  09-22-2006, 5:22 PM

    Really need help matching stylesheet links in html

    Hey, I'm really hoping someone can help me out here. I need to match all of the stylesheet links in a page, but only the ones that use text/css as the type.

    Im currently using these 2 expressions:

    /<link.+?href=[\"'](.*?)[\"']/si

    /@import [\"'](.*?)[\"']/si

    They match properly but includes other media types than just css, like RSS feeds and such. I've been looking on Regexlib.com, Google, etc. Can't figure this out for the life of me. Can someone recommend some more robust versions that are pretty solid?

     

View Complete Thread