OK i have for example this string "hello my name is : yehuda hello my
brother name is yehuda"
Now I would like to split it in to array
so if I'll just use this:
preg_match_all("/hello.+yehuda/s", $data, $out, PREG_PATTERN_ORDER);
the function will use only the last yehuda as my splitter and keep the
string/
so how do i express string which shouldn't contain other string?
thanks 5 1465
Gandalf nous disait :
preg_match_all("/hello.+yehuda/s", $data, $out, PREG_PATTERN_ORDER);
so how do i express string which shouldn't contain other string?
Try to limit the action of your + with +? like this : /hello.+?yehuda/
--
Nicolas - 06 20 71 62 34 - http://nicolas.bouthors.org/album/
On Aug 17, 4:09*am, Russell Wood <bitbuc...@dynode.netwrote:
On 2008-08-16, Gandalf <goldn...@gmail.comwrote:
OK i have for example this string "hello my name is : yehuda hello my
brother name is yehuda"
Now I would like to split it in to array
so if I'll just use this:
preg_match_all("/hello.+yehuda/s", $data, $out, PREG_PATTERN_ORDER);
the function will use only the last yehuda as my splitter and keep the
string/
so how do i express string which shouldn't contain other string?
If you want to split the string into an array at each space then use
`explode':
* * * *http://au.php.net/manual/en/function.explode.php
--
Russell Wood
<http://www.dynode.net/~rjw/>
ye I know explode but this is only an example my real code function
need regular expression
so is their something I can write instead of "." so a specific string
wont be include?
thanks!
On 2008-08-16, Gandalf <go******@gmail.comwrote:
OK i have for example this string "hello my name is : yehuda hello my
brother name is yehuda"
Now I would like to split it in to array
so if I'll just use this:
preg_match_all("/hello.+yehuda/s", $data, $out, PREG_PATTERN_ORDER);
the function will use only the last yehuda as my splitter and keep the
string/
so how do i express string which shouldn't contain other string?
If you want to split the string into an array at each space then use
`explode': http://au.php.net/manual/en/function.explode.php
--
Russell Wood
<http://www.dynode.net/~rjw/>
On Aug 16, 10:31*pm, Gandalf <goldn...@gmail.comwrote:
On Aug 17, 4:09*am, Russell Wood <bitbuc...@dynode.netwrote:
On 2008-08-16, Gandalf <goldn...@gmail.comwrote:
OK i have for example this string "hello my name is : yehuda hello my
brother name is yehuda"
Now I would like to split it in to array
so if I'll just use this:
preg_match_all("/hello.+yehuda/s", $data, $out, PREG_PATTERN_ORDER);
the function will use only the last yehuda as my splitter and keep the
string/
so how do i express string which shouldn't contain other string?
If you want to split the string into an array at each space then use
`explode':
* * * *http://au.php.net/manual/en/function.explode.php
--
Russell Wood
<http://www.dynode.net/~rjw/>
ye I know explode but this is only an example my real code function
need regular expression
so is their something I can write instead of "." so a specific string
wont be include?
thanks!
You may want to take a look at http://www.troubleshooters.com/codec...rl/perlreg.htm.
It should give you a better understanding of regex's. You should find
your answer here.
Gandalf wrote:
OK i have for example this string "hello my name is : yehuda hello my
brother name is yehuda"
Now I would like to split it in to array
so if I'll just use this:
preg_match_all("/hello.+yehuda/s", $data, $out, PREG_PATTERN_ORDER);
the function will use only the last yehuda as my splitter and keep the
string/
so how do i express string which shouldn't contain other string?
thanks
I'm not sure I understand what you're trying to do, exactly. It sounds
like you might want preg_split, though. If you could post an example
of what you do want, it might help.
--
Curtis This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kenneth McDonald |
last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate
feedback, suggestions, and criticism as I work towards finalizing the
API and feature sets. rex is a module intended to make...
|
by: Sehboo |
last post by:
Hi,
I have several regular expressions that I need to run against
documents. Is it possible to combine several expressions in one
expression in Regex object. So that it is faster, or will I...
|
by: Sehboo |
last post by:
Hi,
I have several regular expressions that I need to run against
documents. Is it possible to combine several expressions in one
expression in Regex object. So that it is faster, or will I...
|
by: Együd Csaba |
last post by:
Hi All,
I'd like to "compress" the following two filter expressions into one -
assuming that it makes sense regarding query execution performance.
.... where (adate LIKE "2004.01.10 __:30" or...
|
by: Allan Ebdrup |
last post by:
I have a dynamic list of regular expressions, the expressions don't change
very often but they can change. And I have a single string that I want to
match the regular expressions against and find...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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,...
|
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |