473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 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 1116

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

Similar topics

6
by: Sean Bartholomew | last post by:
i have a bit of a problem. im parsing a record string using strtok but im encountering back to back whitespaces (\t\t) due to empty fields from my database export. the STRTOK function reads up to...
15
by: voipcanada | last post by:
is there any thing we can write to keep the right txt to the = sign in the preg_split. from the following lines DST-NUMBER-IN=0033512877596, DST-NUMBER-OUT=98751#33512877596,...
8
by: Franklin Li | last post by:
Hi all, I have one simple program: #define __EXTENSIONS__ #include <stdio.h> #include <string.h> int main() { char *buf="5/90/45"; char *token;
3
by: none | last post by:
Hello: Using PHP 4.3.11 The line: $strDate = preg_split('//', $my_date); works to break apart a date in the form mm/dd/yyyy or mm.dd.yyyy or mm-dd-yyyy but the line: $strDate =...
7
by: Felix85 | last post by:
I am trying to make a command interpreter for a mud that i am working on the problem i am having right now is that i cannot convert the string into a char array. This is the error I am getting...
18
by: Pedro Pinto | last post by:
Hi there once more........ Instead of showing all the code my problem is simple. I've tried to create this function: char temp(char *string){ alterString(string); return string;
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
4
by: Alan | last post by:
How do I convert the type const char* to type char*? I have an input string ("input_string") of class string. I need to convert this to type char* in order to use it in a call to the strtok()...
4
by: kretik | last post by:
I've been trying to coax this class to use something other than the default '$' but it seems setting it to something else has no discernible effect. Is it necessary to inherit from the class to do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.