Need Regex for phone number

2010-09-24 Thread lotug
I need regex code to identify 3108222400 phone number. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Need Regex for phone number

2010-09-24 Thread Goke Aruna
Ernest, Can you be a bit more detail into what you have and what you want? Thank On 9/23/10, lotug erne...@ernestoreyes.com wrote: I need regex code to identify 3108222400 phone number. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

Re: Need Regex for phone number

2010-09-24 Thread Yogesh Sawant
On Fri, Sep 24, 2010 at 12:50 AM, lotug erne...@ernestoreyes.com wrote: I need regex code to identify 3108222400 phone number. If all of your phone numbers are ten digit, then: die $phone_num is not a ten digit number unless ($phone_num =~ m/^\d{10}$/); Do you need to include any more

Re: Need Regex for phone number

2010-09-24 Thread Randal L. Schwartz
lotug == lotug erne...@ernestoreyes.com writes: lotug I need regex code to identify 3108222400 phone number. This question was posted (with the same vagueness) to comp.lang.perl.misc. Check out some of the answers there. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1

Need Regex help !!

2003-07-11 Thread Pandey Rajeev-A19514
Hi, In short, I have a defined set of pattern that can occur across any number of lines(scalars) in a buffer (array of scalars) and I need to print only those lines(Scalars) that contain the full or partial pattern. For eg. For the buffer @buff (as shown below), I have to find out the

Re: Need Regex help !!

2003-07-11 Thread Rob Anderson
Hi Rajeev, I'm not sure why you feel the need to join your buffer into a big string. From what you describe couldn't you just process each buffer element one by one? foreach my $buffer_entry (@buff) { if($buffer_entry =~ /(FastEthernet|down)/i) { print $buffer_entry; } } Let us

RE: Need Regex help !!

2003-07-11 Thread Pandey Rajeev-A19514
Message- From: Rob Anderson [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 3:13 PM To: [EMAIL PROTECTED] Subject: Re: Need Regex help !! Hi Rajeev, I'm not sure why you feel the need to join your buffer into a big string. From what you describe couldn't you just process each buffer element

Re: Need Regex help !!

2003-07-11 Thread Rob Dixon
Pandey Rajeev-A19514 wrote: Rob ANderson wrote: Pandey Rajeev-A19514 wrote: In short, I have a defined set of pattern that can occur across any number of lines(scalars) in a buffer (array of scalars) and I need to print only those lines(Scalars) that contain the full or partial

Re: Need Regex help !!

2003-07-11 Thread Kevin Pfeiffer
In article [EMAIL PROTECTED], Rob Dixon wrote: Pandey Rajeev-A19514 wrote: Rob ANderson wrote: Pandey Rajeev-A19514 wrote: In short, I have a defined set of pattern that can occur across any number of lines(scalars) in a buffer (array of scalars) and I need to print only those

Re: Need regex

2001-12-17 Thread Jon Molin
read perldoc -f substr /Jon Jorge Goncalvez wrote: Hi, I wanted to have the first 5 elements of a scalar, like for exemple: my $number= E14011 my number2=E1401 How can i do this in Perl, thanks? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Need regex to match all UPPERCASE letters?

2001-07-23 Thread KEVIN ZEMBOWER
I need help writing a regular expression that will match lines that have only upper case letters, and sometimes slashes and spaces, but won't match lines with mixed case. Lines that must be matched are like: FAMILY PLANNING / REPRODUCTIVE HEALTH POLICY FAMILY PLANNING / REPRODUCTIVE HEALTH

RE: Need regex to match all UPPERCASE letters?

2001-07-23 Thread Chris Mulcahy
$_ !~ /[a-z]/ Easy enough! hth Chris -Original Message- From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]] Sent: Monday, July 23, 2001 8:49 AM To: Subject: Need regex to match all UPPERCASE letters? I need help writing a regular expression that will match lines that have only

Re: Need regex to match all UPPERCASE letters?

2001-07-23 Thread KEVIN ZEMBOWER
Jeff and John, thanks for your help. I'm invoking my script with a command line loop: perl -n pop2html.pl 2001-07-16.txt The file pop2html.pl, incorporating your suggestion, is: if (! /[a-z]/) {chomp; print h4$_/h4\n; next;} if (/^\s*$/) { print br\n; next;} The tail of the file 2001-07-16.txt

Re: Need regex to match all UPPERCASE letters?

2001-07-23 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 23, KEVIN ZEMBOWER said: Jeff and John, thanks for your help. I'm invoking my script with a command line loop: perl -n pop2html.pl 2001-07-16.txt The file pop2html.pl, incorporating your suggestion, is: if (! /[a-z]/) {chomp; print h4$_/h4\n; next;} if (/^\s*$/) { print br\n; next;} The