On Wed, Aug 01, 2007 at 08:05:09PM -0700, Jack Bates wrote:
> I'm not sure how to get an array of all subexpression matches, in the
> order matches appear in the subject, instead of the order expressions
> appear in the pattern.

This problem gave me a headache. My only idea is to use preg_split()
instead.

  <?php
  $foo = preg_split('/\[(.*)\]+|\./U',
         "foo.bar[ab.cd].baz",
         -1,
         PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);

  var_dump($foo);
  ?>

Seems to work as intended. Hope I could help.

Regards
  Steffen

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

Reply via email to