From: Rodrigo Tavares [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 11, 2007 9:31 AM
To: [email protected]
Subject: Using regular expressions with delimitaters
Hello,
I need to use the delimiter " " , (one blank space).
I read perdoc, i try to use this :
if ( "8.1.8" =~ /[\d $versao \s]/)
But the expression is always true.
Where is the error ?
my code :
#!/usr/bin/perl
$version=`/usr/local/pgsql/bin/pg_ctl --version`;
print $version;
if ( "8.1.8" =~ /$version/)
{
print "$version\n";
}
else
{
print "Wrong version !\n";
}
Output, about program:
pg_ctl (PostgreSQL) 8.1.8
Wrong version
Best regards,
Rodrigo Faria
[>>]
Maybe you are making this too hard...
perl -e '$date=`date`; print "Is Apr\n" if $date =~ /Apr/;'
As an example...
Hope this helps...
[>>] jwm
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/