First, I am not very good in regex so there may be a mistake in here. I got the following regex pattern I created :
`(?:\\&|[^&])*` (PHP : `/(?:\\&|[^&])*/s`)
to parse the kind of the following string :
hfghfg=hfghfg&gfdgdf=4343543&gfdgfdgfd=fsdfds\&hghg999
Espresso give me this :
hfghfg=hfghfg
NULL
gfdgdf=4343543
NULL
gfdgfdgfd=fsdfds\&hghg999
NULL
So it does the same as explode('&', $String) but if \& is found, it won’t cut.
But in PHP, preg_match_all and preg_match give me this :
preg_match_all('/(?:\\&|[^&])*/s',
implode('', $this->Grecko->Input->Server('argv')),
$Args, PREG_PATTERN_ORDER);
print_r($Args);
Array
(
[0] => Array
(
[0] => hfghfg=hfghfg&gfdgdf=4343543&gfdgfdgfd=fsdfds\&hghg999
[1] =>
)
)
I think what you need is
preg_split()rather thanpreg_match_all().