Re: pattern matching problems

2006-07-08 Thread Mike Williams
Dr. Claus-Peter Becke wrote: > foreach (/(\w+)/i) { > push @words,$&; > } > print$q->popup_menu('to_thesaurus', @words); > > this solution succeeds in finding and returning the last element... There are a few problems here: 1. regex should use the /g modifier to find all matches in the stri

Re: Pattern matching

2003-12-05 Thread B. Fongo
I went back to my books to refresh my memory on how to use references. Your suggestion help a lot, but the subroutine returns wrong values. I did some small modifications on the codes below , and tried it. It return perl-5.8.0-80.3.i386.rpm and samba-2.2.7-5.8.0.i386.rpm, which is wrong because:

Re: pattern matching for serial number

2002-04-26 Thread Joshua Hayden
<[EMAIL PROTECTED]> To: "Kamali Muthukrishnan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, April 26, 2002 9:48 AM Subject: RE: pattern matching for serial number > well, the second slash should follow immediately after the bracket

RE: pattern matching for serial number

2002-04-26 Thread Tim Doty
L PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: pattern matching for serial number > > > Sorry, while typing I missed the slash, it is there in my code as - > if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} /) > Is there any thing wrong with this ? > Kamali > >>

Re: pattern matching for serial number

2002-04-26 Thread Kamali Muthukrishnan
Sorry, while typing I missed the slash, it is there in my code as - if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} /) Is there any thing wrong with this ? Kamali >>> fliptop <[EMAIL PROTECTED]> 04/26/02 08:54AM >>> Kamali Muthukrishnan wrote: > Hi guys : > I have serial numbers with a pattern : 3 nu

RE: pattern matching for serial number

2002-04-26 Thread Bob Showalter
> -Original Message- > From: Kamali Muthukrishnan [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 26, 2002 9:39 AM > To: [EMAIL PROTECTED] > Subject: pattern matching for serial number > > > Hi guys : > I have serial numbers with a pattern : 3 numbers followed by > 2 capital letters fo

Re: pattern matching for serial number

2002-04-26 Thread fliptop
Kamali Muthukrishnan wrote: > Hi guys : > I have serial numbers with a pattern : 3 numbers followed by 2 capital letters >followed by 3 numbers. > To validate this - > if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} ) > { # display error ; } > I get a syntax error. i think you're missing a