"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
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
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
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;
>
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;
$pattern2 is a "subpattern" of $patter
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
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 ".j
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
> 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
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 can I tweak it
10 matches
Mail list logo