Daniel Lahey wrote:

I'm trying to figure out how to formulate a regular expression that will get me everything following a pound sign (#) up to the first space or { character. (I'm trying to parse the ids out of a style sheet.) Can anyone point me in the right direction? I've been searching on the web for hours and reading everything I can find on regular expressions, but I just can't wrap my brain around it. Thanks.

preg_match_all('/#([^\s{]+)/',$style_sheet,$matches);

$matches[1] should have all of the matches...

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to