Hello Friends,
I am confused and hence coded a small RegEx statement.
I am now having more questions. Would appreciate, if
you can help:
Here is my code:
C:\>perl -e "$str = 'null knot';
$str=~m/(null(?!\s?not))/; print $+;"
The Output is:
null
Question 1: Should I not expect the full string '
Here '?!\s?not' after 'null' means 'null' is not
followed by zero/one whitespace followed by 'not'. So
the $+ will get 'null'.
but if u want 'null knot' then write
$str=~m/(null\s?knot)/
here the result will be 'null knot'
--- RTO RTO <[EMAIL PROTECTED]> wrote: > Hello
Friends,
>
> I am confused
^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
1. ^([a-zA-Z0-9_\-\.]+)@
Can contain a group of letters (case insensitive) or numbers (0-9), a
period, underscore, hyphen and the @ sign is required.
2. ([a-zA-Z0-9_\-\.]+)\.
Can contain a group of letters (case insensitive) or numbers (0-9), a
period, hyphen, underscore and end with a period.
3.
A better one for email may be
[EMAIL PROTECTED]
\.]*[a-zA-Z]$
-Original Message-
From: Omega -1911 [mailto:[EMAIL PROTECTED]
Sent: 24 October 2007 08:48
To: beginners perl
Subject: Re: Trying to figureout regex please help
1. ^([a-zA-Z0-9_\-\.]+)@
Can contain a group of letters (case
Or If you want to be really silly
http://ex-parrot.com/~pdw/Mail-RFC822-Address.html
-Original Message-
From: Andrew Curry [mailto:[EMAIL PROTECTED]
Sent: 24 October 2007 09:13
To: Omega -1911; beginners perl
Subject: RE: Trying to figureout regex please help
A better one for email
lt;[EMAIL PROTECTED]>, "Omega -1911" <[EMAIL PROTECTED]>,
"beginners perl"
Sent: Wednesday, October 24, 2007 10:13:52 AM (GMT+0200) Asia/Jerusalem
Subject: RE: Trying to figureout regex please help
Or If you want to be really silly
http://ex-parrot.com/~pdw/Mail-RFC82
Andrew Curry schreef:
> Or If you want to be really silly
> http://ex-parrot.com/~pdw/Mail-RFC822-Address.html
What is silly about that? It is not complete though.
See also:
http://search.cpan.org/~abigail/RFC_RFC822_Address/Address.pm
http://search.cpan.org/~rjbs/Email-Valid/lib/Email/Valid.p
address
-Original Message-
From: newBee [mailto:[EMAIL PROTECTED]
Sent: 24 October 2007 01:07
To: beginners@perl.org
Subject: Trying to figure the Regex Please Help
^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$
--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
On 10/24/07, Andrew Curry <[EMAIL PROTECTED]> wrote:
> ^([a-zA-Z0-9_\-\.]+ # any character repeated from the set memorized into $1
> )@ # followed by an @
> ([a-zA-Z0-9_\-\.]+) # any character repeated from the set memorized into $2
> \.([a-zA-Z]{2,5})$ # any alphabetic character in both cases 2 -
11 matches
Mail list logo