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

pattern matching problems

2006-07-07 Thread Dr. Claus-Peter Becke
lve the problem (for example using the binding operator and if control structures) showed of how to use an array-variable in a scalar context. after having used a 5 word string the array variable in which the elemensts of the string had been stored contained the value 5. can anybody help me so

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:

Pattern matching

2003-12-04 Thread B. Fongo
how to get the pattern matching correctly. == sub select_newer { my (@remote_packages, @installed_packages); (@remote_packages, @installed_packages) = @_; foreach (@installed_packages){ my $i = grep {$_} @remote_packages &&

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 follo

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

pattern matching for serial number

2002-04-26 Thread Kamali Muthukrishnan
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. Can you help me , please ? Kamali -- To unsubscribe, e-mail: [EMAI

Re: Need help in pattern matching.

2001-12-17 Thread fliptop
[reply cc'd to list] lakshmi nrusimhan wrote: > Sorry here > $t="Apple\nMango\n"; > Actually what i mentioned in the output is what i want > the output to be. I wanna replace > Apple > Mango > by > some three lines. > The sequence Apple, Mango shd. be there for > replacement and it won't

Re: Need help in pattern matching.

2001-12-16 Thread fliptop
lakshmi nrusimhan wrote: > Consider the following lines: > > Apple > Mango > Banana > Orange > > I want to replace line 1, line 2 i.e. (Apple, Mango) > with hello1\nhello2\nhello3\n. > > The output should be: > hello1 > hello2 > hello3 > Banana > Orange > > I tried something like this: > $t="

Need help in pattern matching.

2001-12-16 Thread lakshmi nrusimhan
Hi All, Could anyone tell me how to do the following usinf Perl. Consider the following lines: Apple Mango Banana Orange I want to replace line 1, line 2 i.e. (Apple, Mango) with hello1\nhello2\nhello3\n. The output should be: hello1 hello2 hello3 Banana Orange I tried something like