Re: matching patterns - - - EXPLANATION

2003-04-04 Thread R. Joseph Newton
"R. Joseph Newton" wrote: Sorry Diego, Turns out that there was a logic error in the code I posted that gave a false positive on the match. > #!perl -w > > use strict; > use warnings; > > my $pat1 = qr /Hi.*?\sBye/; > # my $pat2 = qr /(Hi|[Hh]ello).*?\sBye--I'll sure miss you\!/; # Error Th

Re: matching patterns - - - EXPLANATION

2003-04-03 Thread R. Joseph Newton
Diego Riano wrote: > I am trying to put it in a better way, (I hope :-)) > > What I am trying to do is check if two patterns could recognize the same > string, for example: > $pattern1=[ag]oprs[cd]x9; > $pattern2=[agpr]oprs; > > these two patterns would recognize, both, a set of strings. howe

Re: matching patterns - - - EXPLANATION

2003-04-03 Thread Diego Riano
I am trying to put it in a better way, (I hope :-)) What I am trying to do is check if two patterns could recognize the same string, for example: $pattern1=[ag]oprs[cd]x9; $pattern2=[agpr]oprs; these two patterns would recognize, both, a set of strings. however there will be some strings tha

Re: matching patterns

2003-04-03 Thread Stefan Lidman
Diego Riano wrote: > > Hello All > > I am having problem figuring out how to match two patterns. I have two > pattern and I would like to now if they are the same or if one of them > is a sub pattern of the other. Ej: > $pattern1=[agpr]oprs[cd]x9; > $pattern2=[agpr]oprs; > $pattern3=aors; >

Re: matching patterns

2003-02-05 Thread Rob Dixon
Mario Kulka wrote: > I am trying to extract ".jpg" (subtype of the file) from the string: > c:\my_files\file.jpg Two more: $type = (split /\./, $string)[-1]; or ($type) = $s =~ m[.*\.(.*)]; Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

RE: matching patterns

2003-02-05 Thread yargo
or just : my $String = "c:\my_files\file.jpg"; my (undef, $Ext) = (split /\./, $String); -Original Message- From: mario kulka [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 8:30 PM To: [EMAIL PROTECTED] Subject: matching patterns I am trying to extract ".jpg" (subtype of

RE: matching patterns

2003-02-04 Thread Bob Showalter
mario kulka wrote: > I am trying to extract ".jpg" (subtype of the file) from the string: > c:\my_files\file.jpg Mario, I didn't mean to mislead you. Here it _is_ proper to speak of "file extension" (or "suffix"). In the context of a MIME Content-type header like "text/plain", the "plain" is a su

RE: matching patterns

2003-02-04 Thread Mark Anderson
> I am trying to extract ".jpg" (subtype of the file) from the string: > c:\my_files\file.jpg > > I found the following pattern on the net: > $file =~ s/.*[\/\\](.*)/$1/; > which extracts the file name (file.jpg). I understood most of that pattern > except what does the (.*) part does? And how ca