regular expression problem ? and * characters
- From: "compboy" <compboyxyz@xxxxxxxxx>
- Date: 28 May 2006 04:02:48 -0700
Im writing a perl script now and this is part of the sricpt
chomp = ($pattern = ARGV[0]);
for each(@thisarray)
{
if($_ =~ m/$pattern/i)
{
print ("found it here, $_");
}
}
the array @thisarray is given.
this scprit reads from the command line and pass that input the the
pattern
and will check if the pattern match the any string inside the array it
will
print the msg.
I have done this part succesfully if the input is just a normal string
like a ab
my question is how do you imporve it so it can accept the input that
contains* and ?
character(s) like *ab? a*b* *a*
thanks a lot.
.
- Follow-Ups:
- Re: regular expression problem ? and * characters
- From: Eric Bohlman
- Re: regular expression problem ? and * characters
- From: metaperl@xxxxxxxxx
- Re: regular expression problem ? and * characters
- Prev by Date: Net::Server -> tftpd ?
- Next by Date: combining graphs from GD::Graph in one image file
- Previous by thread: Net::Server -> tftpd ?
- Next by thread: Re: regular expression problem ? and * characters
- Index(es):
Relevant Pages
|
|