Re: [pcre] backreferences to all matches of a repeated subexpression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux