But how? The +[a-z]{2,} seems to allow at least two a-z clusters, but it
doesn't include a period. /ml
Almost correct. The plus belongs to whatever comes before it, not after.
So what you're referring to as matching two or more characters but not
the period, is this:
[a-z]{2,}
And this
Hello:
I've adapted this regular expression script from a book, but I'm not
clear why it works.
$email = [EMAIL PROTECTED];
$pattern = /[EMAIL PROTECTED]@([-a-z0-9]+\.)+[a-z]{2,}/;
___
if ( preg_match($pattern,$email) )
{
print yes! . $email . matches!;
}
else { print no match; }
Matthew Lasar wrote:
But I don't understand why the second half of the regular expression
works. I'm talking about this part:
@([-a-z0-9]+\.)+[a-z]{2,}/;
why is it able to detect repeated sections of the email address after
@ that are separated by periods? like @email.alaska.com . It
At 11:32 AM 8/31/2007, Per Jessen wrote:
Matthew Lasar wrote:
But I don't understand why the second half of the regular expression
works. I'm talking about this part:
@([-a-z0-9]+\.)+[a-z]{2,}/;
why is it able to detect repeated sections of the email address after
@ that are separated by
Matthew Lasar wrote:
At 11:32 AM 8/31/2007, Per Jessen wrote:
Matthew Lasar wrote:
But I don't understand why the second half of the regular
expression works. I'm talking about this part:
@([-a-z0-9]+\.)+[a-z]{2,}/;
why is it able to detect repeated sections of the email address
On 8/11/05, Leon Vismer [EMAIL PROTECTED] wrote:
Hi Robin
Many thanks for this,
how would one extend this to support the following:
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'mcDonald');
one does not want
$str = insert into user_comment
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
code
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer');
$match = array(
/([a-z]+)(ID)/,
/([a-z]+)([A-Z])/
);
$replace = array(
\$1_id,
n Thu, 11 Aug 2005, Leon Vismer wrote:
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
code
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer');
$match = array(
/([a-z]+)(ID)/,
Hi
Just a quick note; why dont' you search on user since it's the constant
and replace 'user[A-Z]' with 'user_[a-z]' or in the case of userID
'user[A-Z]{2}'
This is part of my problem user will not always be constant, I basically want
to be able to change between two naming conventions.
On 8/11/05, Leon Vismer [EMAIL PROTECTED] wrote:
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
code
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer');
$match = array(
Hi Robin
Many thanks for this,
how would one extend this to support the following:
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'mcDonald');
one does not want
$str = insert into user_comment (user_id, user_name, user_surname) values (0,
'Leon',
So I'm trying to implement a simple wiki-like syntax for hyperlinking.
Basically I want to match stuff like [this], where the word 'this' gets
turned into a hyperlink. I have that working, but I want to be able to
escape the opening bracket, so that it's possible to do \[that] without
having
On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote:
So I'm trying to implement a simple wiki-like syntax for hyperlinking.
Basically I want to match stuff like [this], where the word 'this' gets
turned into a hyperlink. I have that working, but I want to be able to
escape the
Rob Ellis wrote:
On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote:
So I'm trying to implement a simple wiki-like syntax for hyperlinking.
Basically I want to match stuff like [this], where the word 'this' gets
turned into a hyperlink. I have that working, but I want to be able to
So I want to grab the attributes out of an HTML element. The following
works, except in the case that the attribute's value includes the character
:
if (preg_match_all(/tag([^]*)/i, $subject, $matches))
print_r($matches);
A $subject of tag attr=\value\ gives:
Array
(
[0] = Array
] Regular expression question
So I want to grab the attributes out of an HTML element. The following
works, except in the case that the attribute's value includes the
character
:
if (preg_match_all(/tag([^]*)/i, $subject, $matches))
print_r($matches);
A $subject of tag attr=\value\ gives
]
Sent: Monday, August 04, 2003 4:03 PM
Subject: [PHP] Regular expression question
So I want to grab the attributes out of an HTML element. The following
works, except in the case that the attribute's value includes the
character
:
if (preg_match_all(/tag([^]*)/i, $subject, $matches
I've got a regexp:
(EV[0-9]{2})!([0-9]{4}-[0-9]{2}-[0-9]{2})!(GR[0-9]{2}).txt
My question is, will it match this:
EV01!2002-11-09!VR01!GR01.txt
And anything formatted like this: (EV02, and so forth).
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
It might, you should test it to find out.
John Meyer wrote:
I've got a regexp:
(EV[0-9]{2})!([0-9]{4}-[0-9]{2}-[0-9]{2})!(GR[0-9]{2}).txt
My question is, will it match this:
EV01!2002-11-09!VR01!GR01.txt
And anything formatted like this: (EV02, and so forth).
--
PHP General Mailing
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...so I'm basically
asking someone to help :)
Say I have a string like this jeD1GLal
I want to remove any of the chracters that be
Hello,
I have a little question regarding regular expressions... I want to check
for the pattern
$num::
But, $num may not be started with another number (assume the number will be
51 , 1 will also match (the pattern 1:: is available in 51::) ... Currently,
my regular expression is:
? see what i mean?
- Original Message -
From: Leon Mergen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 09, 2001 1:53 PM
Subject: [PHP] Regular expression question
Hello,
I have a little question regarding regular expressions... I want to check
for the pattern
$num
I want to replace a string like this 1B335-2G with this B335. So for all the
strings I want to remove the first character and the last three characters.
I'm not sure which replace function to use or how to go about it. Thanks.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To
Subject: [PHP] Regular Expression Question
I want to replace a string like this 1B335-2G with this B335. So for all the
strings I want to remove the first character and the last three characters.
I'm not sure which replace function to use or how to go about it. Thanks.
Jeff Oien
--
PHP General
$newstring = substr($string,1,4);
FOUR, not FIVE. Doh.
-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 22:03
To: [EMAIL PROTECTED]; PHP
Subject: RE: [PHP] Regular Expression Question
since you know exactly which 4 characters you want to keep you can
that. No need for complicated regular expressions either
way.
- seb
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 21:47
To: PHP
Subject: [PHP] Regular Expression Question
I want to replace a string like this 1B335-2G with this B335. So for all
I hope my later message clarifys what I mean.
- seb
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 22:05
To: PHP
Subject: RE: [PHP] Regular Expression Question
Aren't the trims just for white space?
Jeff Oien
since you know exactly which 4
PROTECTED]]
Sent: Wednesday, July 25, 2001 5:09 PM
To: [EMAIL PROTECTED]; PHP
Subject: RE: [PHP] Regular Expression Question
I hope my later message clarifys what I mean.
- seb
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 22:05
To: PHP
Subject: RE: [PHP
Hello,
I was wondering if there is a way to match a pattern, then delete the entire
line containing the pattern. I.E. (if I was searching for pattern in a
file containing
pattern:info:info:info
pattern2:info:info:info
pattern3:info:info:info
is there a way to delete the entire, and only the
29 matches
Mail list logo