468,278 Members | 1,574 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,278 developers. It's quick & easy.

Why preg_split works only if the char # before the delimiter is 21 or less?

Why preg_split works only if the char # before the delimiter is 21 or less?
example php code:
=============
[PHP]$right = "{Hello Im very aaaaaa {cool|not cool}}";
print $right."<br>";
$pattern = '/({(?:[^{}]+(?:"[^"]*"|\'[^\']*\')?)+})/';
$snip_array = preg_split($pattern, $right, -1, PREG_SPLIT_DELIM_CAPTURE);
print_r($snip_array);[/PHP]
============
If I change [PHP]$right = "{Hello Im very aaaaa {cool|not cool}}";[/PHP] the
above code works correctly. Is there a solution to this or am I doing something stupid?

Thanks,
Todd
tiggman@gmail.com
Oct 30 '06 #1
0 956

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Sean Bartholomew | last post: by
15 posts views Thread by voipcanada | last post: by
8 posts views Thread by Franklin Li | last post: by
3 posts views Thread by none | last post: by
7 posts views Thread by Felix85 | last post: by
18 posts views Thread by Pedro Pinto | last post: by
3 posts views Thread by Hamilton Woods | last post: by
4 posts views Thread by Alan | last post: by
4 posts views Thread by kretik | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.