471,046 Members | 1,111 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,046 software developers and data experts.

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 1017

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.