On 1 July 2010 06:47, Gaurav Kumar wrote:
> Hey Richard,
>
> Thanks!!! You have resolved my problem..
>
> GK
>
>
> On Wed, Jun 30, 2010 at 7:42 PM, Gaurav Kumar
> wrote:
>
>> Hi All,
>>
>> Need help in resolving the below problem-
>>
>>
>> I would like to get the whole comma separated string into
Hey Richard,
Thanks!!! You have resolved my problem..
GK
On Wed, Jun 30, 2010 at 7:42 PM, Gaurav Kumar
wrote:
> Hi All,
>
> Need help in resolving the below problem-
>
>
> I would like to get the whole comma separated string into an array value-
>
> 1. $postText = "chapters 5, 6, 7, 8";
> OR
>
Not tested, but I think it should work:
preg_match_all('/(\d+),/', $postText, $matches);
--
João Cândido de Souza Neto
"Gaurav Kumar" escreveu na mensagem
news:aanlktikdb_ismnkpomicxzsfzixg4dedznunrcimj...@mail.gmail.com...
> Hi All,
>
> Need help in resolving the below problem-
>
>
> I wou
Shiplu wrote:
Sorry The previous code was wrong,
Its the correct version,
$x = "a b;c d;e f;";
preg_match('/(?P\w) (?P\w)/',$x,$m);
print_r($m);
Now I am using backrefrence \1 in in ?P option like (?P<\1>\d+).
and I got the error.
thought I best update for courtesy sake; I spent a good chun
Sorry The previous code was wrong,
Its the correct version,
$x = "a b;c d;e f;";
preg_match('/(?P\w) (?P\w)/',$x,$m);
print_r($m);
Now I am using backrefrence \1 in in ?P option like (?P<\1>\d+).
and I got the error.
--
Blog: http://talk.cmyweb.net/
Follow me: http://twitter.com/shiplu
Stop
On 9/27/08, Nathan Rixham <[EMAIL PROTECTED]> wrote:
> Shiplu wrote:
>
> > The string is "charge100".
> > I want and array( "charge"=>100).
> > I am using this regular expression,
> > '/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'.
> >
> >
> > But its not working..
> >
> > I get this error.,
> > PHP Warning:
Shiplu wrote:
The string is "charge100".
I want and array( "charge"=>100).
I am using this regular expression,
'/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'.
But its not working..
I get this error.,
PHP Warning: preg_match(): Compilation failed: syntax error after (?P
at offset 25 in E:\src\php\WebEngin
Shiplu wrote:
The string is "charge100".
I want and array( "charge"=>100).
I am using this regular expression,
'/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'.
But its not working..
I get this error.,
PHP Warning: preg_match(): Compilation failed: syntax error after (?P
at offset 25 in E:\src\php\WebEng
On 9/27/08, Al <[EMAIL PROTECTED]> wrote:
> What's the complete row? e.g.,
>
> charge100
>
> Or, are there other cells in the row?
No TD cells. forget the real world problem.
I made the exact replica of that. I need the sample work.
--
Blog: http://talk.cmyweb.net/
Follow me: http://twitter.c
On 9/27/08, Nathan Rixham <[EMAIL PROTECTED]> wrote:
> Shiplu wrote:
>
> > The string is "charge100".
> > I want and array( "charge"=>100).
> > I am using this regular expression,
> > '/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'.
> >
> >
> > But its not working..
> >
> > I get this error.,
> > PHP Warning:
What's the complete row? e.g.,
charge100
Or, are there other cells in the row?
Shiplu wrote:
The string is "charge100".
I want and array( "charge"=>100).
I am using this regular expression,
'/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'.
But its not working..
I get this error.,
PHP Warning: preg_matc
Shiplu wrote:
The string is "charge100".
I want and array( "charge"=>100).
I am using this regular expression,
'/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'.
But its not working..
I get this error.,
PHP Warning: preg_match(): Compilation failed: syntax error after (?P
at offset 25 in E:\src\php\WebEngin
Jay Blanchard wrote:
Given the string 'foo''bar''glorp' (all quotes are single quotes)I had
hoped to find a regular expression using preg_match that would return an
array containing just those words without having to go through
additional gyrations, like exploding a string to get an array. I have
First stripslashes() and all newlines [\n\r*]. It makes the regex much easier.
$pattern= "%%i;
preg_match($pattern, $string, $match); If more than one in the string, use
preg_match_all().
Now print_r($match); so you can see the result.
Now, read the doc and see why each term is used. Note, I
Dave M G wrote:
PHP,
Shouldn't this regular expression select everything from the start of
the string to the first space character:
$firstWord = preg_match('#^*(.*) #iU', $word);
It doesn't, so clearly I'm wrong, but here's why I thought it would:
The enclosing has marks, "#", I *think* jus
Dave M G schrieb:
PHP,
Shouldn't this regular expression select everything from the start of
the string to the first space character:
$firstWord = preg_match('#^*(.*) #iU', $word);
It doesn't, so clearly I'm wrong, but here's why I thought it would:
The enclosing has marks, "#", I *think* j
Steve Turnbull wrote:
Hey folks
I don't want to "just get you to do the work", but I have so far tried
in vain to achieve something...
I have a string similar to the following;
cn=emailadmin,ou=services,dc=domain,dc=net
I want to extract whatever falls between the 'cn=' and the following
comm
Steve Turnbull wrote:
Hey folks
I don't want to "just get you to do the work", but I have so far tried
in vain to achieve something...
I have a string similar to the following;
cn=emailadmin,ou=services,dc=domain,dc=net
I want to extract whatever falls between the 'cn=' and the following
comm
Barry wrote:
Simple reg help please
i want to match the last "," in "a,b,c,d" and replace it with " and "
i tried ereg_replace(",([a-zA-z])*$"," and ",$string);
but i forgot how to add the "d" which is also matched now back to the
" and "
Can you give any good reg_exp sites where to learn it?
babu wrote:
HI,
how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. using preg_match.
thanks
babu
-
How much free photo storage do you get? Store your holiday snaps for FREE with
Yahoo! Photos. Get Yahoo! Photos
Yo
How about using the lower() function?
Leon Vismer wrote:
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
$str = "insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer')";
$match = array(
"/([a-z]
You were right, I removed the reference to global $mac and it started
working great. Thanks. It seems sometimes another set of eyes to catch
stuff really helps... thanks.
Jason wrote:
Jason wrote:
Simple functions to check & fix if necessary invalid formating of a
MAC address... I seem to be
Hi,
>From what i can see you dont even need to call global, as your passing
variables to the function ? this could be causing the script to
confuse itself.
hth
On Fri, 21 Jan 2005 09:30:21 -0700, Jason <[EMAIL PROTECTED]> wrote:
> Jason wrote:
> > Simple functions to check & fix if necessary i
Jason wrote:
Simple functions to check & fix if necessary invalid formating of a MAC
address... I seem to be having problems with the global variable $mac
not being returned from the fix_mac() function. Any help is appreciated.
global $mac;
if( eregi(
"^[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-
On Wed, 24 Nov 2004 13:17:48 -0500, Ankur Os wrote:
> Hi,
>
> This is quite simpal problem that i want to made regular expression which
> can read this kind of structure...
>
> a,b,c
>
> not like this
>
> 1. ,a,a,a
> 2. a,,,aa,,
> 3. a,a,a,,,
>
> means simpal structure with comma (a,b,c...
Oh ... you forgot to include your account-info so i won't be able to
send you the money :-/
[...]
You're too nice..
Btw, I need some money. Send me money ASAP. It must be an amount
greater than $200, and be delivered to me directly, thank you.
[...]
--
PHP General Mailing List (http://www.php.net/)
* Thus wrote Red Wingate:
> First of all check who u credit :p
> Secondly why don't you just try to fix it yourself?
>
> There was just a typo in the regexp:
> - #^from\s*:\s*([^>]+)(<([^>]+)>)?#si
> + #^from\s*:\s*([^<]+)(<([^>]+)>)?#si
>
> Hopefully this will help you even more:
>
You're too
Yeah i used ur coding below and i got the solution for my problem.
Thanks Aidan
Syed
- Original Message -
From: "Syed Ghouse" <[EMAIL PROTECTED]>
To: "php mailinglists" <[EMAIL PROTECTED]>
Sent: Wednesday, June 30, 2004 PM 04:45
Subject:
First of all check who u credit :p
Secondly why don't you just try to fix it yourself?
There was just a typo in the regexp:
- #^from\s*:\s*([^>]+)(<([^>]+)>)?#si
+ #^from\s*:\s*([^<]+)(<([^>]+)>)?#si
Hopefully this will help you even more:
]+)\>)?)#si' ,
$mailLine , $parts );
break ;
- Original Message -
From: "Syed Ghouse" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 30, 2004 PM 04:43
Subject: Re: [PHP] Re: Regular expression
> Thanks Aiden for ur help
>
> i used ur code and i got
>
> name as Red Wingate<
If you still like to gather the information without using any tools:
$email = explode( "\n" , $mailText );
foreach ( $email AS $emailLine ) {
$emailLine = trim( $emailLine );
if ( strtoupper ( substr( $emailLine , 0 , 4 ) ) == 'FROM' ) {
preg_match( '#^from\s*:\s*([^>]+)(<([^>]+)>)?#s
I suggest not using a regex.
There are better tools for parsing an email, for example "formail".
$email = `formail -x Return-Path`;
See google.com for more information
Regards,
Aidan
"Syed Ghouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi All
will anyone give me a soluti
This should work:
^\\ # Don't match if a backslash precedes
\[ # Open bracket
([^\]]+?) # Text, including whitespace
\] # Close bracket
By the way, using a tool called The Regex Coach I solved your problem in
about 10 seconds. For those having regex problems you might
Because the substrings can contain any char-s including
commas. Also I use reg exp not for splitting only but
for validating whether whole string and the substrings
are correctly formatted. Using reg exp requires much less
coding than traditional programming.
>
> Why not just strip out the braces
On Wed, May 05, 2004 at 02:26:25PM +0900, Tumurbaatar S. wrote:
>
> There's an input string like "{str1,str2,...,strN}". I want to capture
> all these strings and due to complexity of them I use a preg_match_all()
> instead of simple split. A pattern for the matching strings is ready but
> I canno
Forgot about curly brackets. The above example is:
/^\{(?:(pattern),)*|(pattern)?\}$/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
an excelent tool: The Regex Coach, its free and you can grab it from
http://weitz.de/regex-coach/
and its available for windows and linux!
luis.
<[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hello all,
>
> For a while I tried in vain to find a decent regular expression teste
* Jas <[EMAIL PROTECTED]>:
> Not sure if anyone knows of a good way to match strings of this type...
> 00:02:8b:0c:2f:09
>
> I have tried this but its not working.
>
> !eregi("^[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}$",$
Hello
If you simply want to check if the fields contains Po BOX simply use the
stripos function or one of the other string functions. They should be
faster than reg ex.
If you still want to use reg ex I suggest using preg_match since it is
faster than ereg.
About your regex:
It will not find o
I figured out what I was doing wrong. My regexp should of looked like
this /]*>(Tampa)<\/a>/ and that made it more specific and kept it
to that match.
Jason Lehman wrote:
I have a script that turns certain words into links. That I am having
no problems with, it is when I want to turn the link
Thanks.
"Ns_andy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> perl: preg_match
> '/\'"]+[\'"]?>/i'
>
> or eregi
> '\'"]+[\'"]?>'
>
>
> --
> Regards,
>
> "Noodle Snacks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > w
perl: preg_match
'/\'"]+[\'"]?>/i'
or eregi
'\'"]+[\'"]?>'
--
Regards,
"Noodle Snacks" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> what would be a simple regular expression for ?
>
> for future reference are there any good references for them?
>
>
> --
$str = "jeD1GLal";
$str = ereg_replace("[1LIO0lio]", "", $str);
something like that...
On Fri, 30 Aug 2002, Jeff Lewis wrote:
> Is there a regular expression that will remove 1, L, I, O, 0 and the
> lowercase equivilants from a varialbe?
>
> I am not horribly well versed in regular expressions.
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Henry) wrote:
> I'm looking for a simple was to correct a list of proper nouns given all in
> lower case!
>
> For example
>
> given $string="london paris rome";
>
> I would like "London Paris Rome".
>
> However there is one cavet; if the wor
preg_match("/]*)/i", $html, $args);
$body_props = $args[1];
preg is much faster/better than ereg.
note the /i at the end of the preg, that makes it case insative, drop the i
if you want it to be case sensative on the match.
-Joe
"John Monfort" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Adam Whitehead) wrote:
> if ((ereg("[^[:alnum:]]",$fn)) || (ereg("[^[:alnum:]]",$sn))) {
> // Do something here
> }
>
> What it's doing is checking two variables to make sure they contain only
> alphanumeric characters.
>
> I have a requireme
> Whooops,
>
> Pasted wrong line. This should do it:
>
> $string = preg_replace("/(\.*\/)+(.*?\.*\/)?/s", "", $string);
Gah... Not.. enough... caffeine: Modification:
$string = preg_replace("/(\.*\/)+(.*?\.*\/)?(\.*)?/s", "", $string);
--
PHP General Mailing List (http://www.php.net/)
To un
Whooops,
Pasted wrong line. This should do it:
$string = preg_replace("/(\.*\/)+(.*?\.*\/)?/s", "", $string);
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrat
Hello,
"Galkov Vladimir" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Need to remove all "../" "/.." from user inputing string to prevent him
> walking and creating files&directories where I don't whant see them/him...
>
> The string:
>
> $path =
> eregi
This should do (but ofcourse you might want to play a bit with it)
$mem =
'
http://www.mydomain.com/mypage.php";>something is fine
http://www.yourdomain.com/yourpage.php";>something is wrong
http://www.yourdomain.com/yourpage.php";>something is fine
http://www.lgwm.org/";>lgwm
http://www.google.c
here's your PHP code,
banana
.46
.55
pear
.38
.51
apple
.59
.33
';
$re2 =
"/.*?]*>.*?]*>(.+?)<\/td>.*?]*>(.+?)<\/td>.*?]*>(.+?
)<\/td>.*?<\/tr>/is";
$re1 = '/(.+?)<\/table>/is';
if (preg_match($re1, $mem, $matches))
{
if (preg_match_all($re2, $matc
Actually I didn't pose my question correctly.
I also needed to grep out the "Link" for use in JS during the process.
I wrapped this in a class file and here is the entry that I ended up with.
Thanks for the assist though...
==
function getPL($plr
> blah blah blah blah blah blah blah blah blah
>
> I think I need to use eregi_replace to make the line look like this:
> blah blah blah blah blah blah blah blah blah href='#'>
Depending on how accurately you have stated the problem, this may work:
$text = 'blah blah blah blah blah blah bla
On Fri, 29 Jun 2001 23:43, Clayton Dukes wrote:
> Okay, here's what I have so far:
>
> ---snip---
> if ((!$email)
>
>|| ($email=="")
>|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
>
>)
> $stop = ""._ERRORINVEMAIL."";
> ---snip---
>
> This works, but how can I add a
Clayton Dukes wrote:
> Okay, here's what I have so far:
>
> ---snip---
> if ((!$email)
>|| ($email=="")
>|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
>)
> $stop = ""._ERRORINVEMAIL."";
> ---snip---
>
> This works, but how can I add a second domain?
> ie:
>
Tr
Okay, here's what I have so far:
---snip---
if ((!$email)
|| ($email=="")
|| (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
)
$stop = ""._ERRORINVEMAIL."";
---snip---
This works, but how can I add a second domain?
ie:
---snip---
if ((!$email)
|| ($email=="")
56 matches
Mail list logo