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_OR DER);
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 1472
Gandalf nous disait :
preg_match_all( "/hello.+yehuda/s", $data, $out, PREG_PATTERN_OR DER);
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...@dyno de.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_OR DER);
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_OR DER);
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...@dyno de.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_OR DER);
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_OR DER);
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 regular expressions
easier to create and use (and in my experience as a regular expression
user, it makes them MUCH easier to create and use.)
I'm still working on formal documentation, and in any case, such
documentation isn't necessarily the...
|
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 have to
use all the expressions seperately?
Here are my regular expressions that check for valid email address and
link
Dim Expression As String =
|
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 have to
use all the expressions seperately?
Here are my regular expressions that check for valid email address and
link
Dim Expression As String =
|
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 adate LIKE "2004.01.10 __:15")
....
into something like this:
.... where adate LIKE "2004.01.10 __:(30/15)" ...
|
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 the first regular expression
that matches the string.
I've gor the regular expressions ordered so that the highest priority is
first (if two or more regular expressions match the string I want the first
one returned)
The code that does this has...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
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 we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |