0

I am trying to write a regular expression that finds stylesheets URLS within text.

I have looked at some pages and some style sheets have .css while some do not. Some have a rel="stylesheet" while some do not. Some have both and some have one or the other.

What can I do to find the stylesheets? Here is what I have so far:

preg_match_all("/<link.+href.+[\"'](.+\.css)[\"'].+>/isU", $this->html, $matches);

I am trying to do this without using the Document Object Model

Get Off My Lawn
  • 30,739
  • 34
  • 150
  • 294

0 Answers0