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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tiggman
    New Member
    • Oct 2006
    • 1

    #1

    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($pat tern, $right, -1, PREG_SPLIT_DELI M_CAPTURE);
    print_r($snip_a rray);[/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.c om
Working...