Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.php Subject: Re: parsing print_r() output with preg_match_all() - question remains unanswered ... Date: Tue, 12 Jan 2016 14:02:11 +0000 Organization: A noiseless patient Spider Lines: 23 Message-ID: <87mvsavqu4.fsf@bsb.me.uk> References: <568d3dcf$0$23748$e4fe514c@news.xs4all.nl> <569362A6.2030707@arnowelzel.de> <56943207.1060207@arnowelzel.de> <5694d0c2$0$23771$e4fe514c@news.xs4all.nl> <5694daea$0$23814$e4fe514c@news.xs4all.nl> <87si23ujik.fsf@bsb.me.uk> <5694f3d9$0$23849$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="2118"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Kl4i11beQesXmvjPVU+oKPrMCJLzZ4wM=" Cancel-Lock: sha1:fAfqS4zMMbBeS8pxgt/yRTJj640= sha1:k1hH6GWN05LT963t/ilqw6iTrgs= X-BSB-Auth: 1.2c1a2edceb8928209b75.20160112140211GMT.87mvsavqu4.fsf@bsb.me.uk Xref: csiph.com comp.lang.php:16208 "R.Wieser" writes: [You've omitted attribution lines.] >> The question, as above, sounds odd because if I do this: >> >> $s = "one, two, two, three, one"; >> preg_match_all('/one|two/', $s, $m); >> var_dump($m); >> >> I get the matches in order. > > Now imagine that the words "one" and "two" are actually two (or more) word > phrases. I was about to answer you specific points when I saw you have an overall answer. If there are any outstanding detail I'll have a go at answering but it seems pointless to go through your questions otherwise. -- Ben.