Re: [pcre] backreferences to all matches of a repeated subexpression
| From: | Richard Lynch | Date: | Wed, 08 Aug 2007 03:08:49 +0000 |
| Subject: | Re: [pcre] backreferences to all matches of a repeated subexpression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260398@lists.php.net to get a copy of this message | ||
On Wed, August 1, 2007 10:05 pm, Jack Bates wrote:
> I'm trying to pull all the components out of strings structured like:
> word followed by any number of ( dot word or square bracketed string )
>
> This is an example: foo.bar[ab.cd].baz
>
> From the above example, I want: array('foo', 'bar', 'ab.cd',
> 'baz');
preg_match_all('|([^\\[\\[\\.]+)|', $text, $matches);
var_dump($matches);
should get you going down the right path...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?