Re: Regular expression help

From: Date: Wed, 25 Aug 2004 10:02:59 +0000
Subject: Re: Regular expression help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194661@lists.php.net to get a copy of this message
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

« previous php.general (#194661) next »