> ""Kammen" == "Kammen van, Marco, Springer SBM NL"
> writes:
Kammen> What am I doing wrong??
Using a regex when something else would be much better.
Stop trying to pound a nail in with a wrench handle.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
h
On 30/11/2010 06:39, Uri Guttman wrote:
"GK" == Guruprasad Kulkarni writes:
GK> Here is another way to do it:
GK> /^127\.0\.0\.([\d]|[1-9][\d]|[1][\d][\d]|[2]([0-4][\d]|[5][0-4]))$/) {
why are you putting single chars inside a char class? [\d] is the same
as \d and [1] is just 1.
A
Rob Dixon wrote:
On 29/11/2010 23:46, John W. Krahn wrote:
As Rob said [2..254] is a character class that matches one character (so
"127.0.0.230" should match also.) You also don't anchor the pattern so
something like '765127.0.0.273646' would match as well. What you need is
something like thi
> "GK" == Guruprasad Kulkarni writes:
GK> Here is another way to do it:
GK> /^127\.0\.0\.([\d]|[1-9][\d]|[1][\d][\d]|[2]([0-4][\d]|[5][0-4]))$/) {
why are you putting single chars inside a char class? [\d] is the same
as \d and [1] is just 1.
also please don't quote entire emails below
>-Original Message-
>From: John W. Krahn [mailto:jwkr...@shaw.ca]
>Sent: Tuesday, November 30, 2010 12:47 AM
>To: Perl Beginners
>Subject: Re: regexp matching nummeric ranges
>As Rob said [2..254] is a character class that matches one character
(so
>"127.
Hi Marco,
Here is another way to do it:
#!/usr/bin/perl
use strict;
use warnings;
my $ip = "127.0.0.1";
if ($ip =~
/^127\.0\.0\.([\d]|[1-9][\d]|[1][\d][\d]|[2]([0-4][\d]|[5][0-4]))$/) {
print "IP Matched!\n";;
} else {
print "No Match!\n";
}
On Tue, Nov 30, 2010 at 11:21 AM, Rob Dixon wrote:
On 29/11/2010 23:46, John W. Krahn wrote:
Kammen van, Marco, Springer SBM NL wrote:
Dear List,
Hello,
I've been struggeling with the following:
#!/usr/bin/perl
use strict;
use warnings;
my $ip = ("127.0.0.255");
if ($ip =~ /127\.0\.0\.[2..254]/) {
print "IP Matched!\n";;
} else {
print "
Kammen van, Marco, Springer SBM NL wrote:
Dear List,
Hello,
I've been struggeling with the following:
#!/usr/bin/perl
use strict;
use warnings;
my $ip = ("127.0.0.255");
if ($ip =~ /127\.0\.0\.[2..254]/) {
print "IP Matched!\n";;
} else {
print "No Match!\n";
}
For a reason i don't
On 29/11/2010 14:22, Kammen van, Marco, Springer SBM NL wrote:
Dear List,
I've been struggeling with the following:
#!/usr/bin/perl
use strict;
use warnings;
my $ip = ("127.0.0.255");
if ($ip =~ /127\.0\.0\.[2..254]/) {
print "IP Matched!\n";;
} else {
print "No Match!\n";
}
For a rea
Dear List,
I've been struggeling with the following:
#!/usr/bin/perl
use strict;
use warnings;
my $ip = ("127.0.0.255");
if ($ip =~ /127\.0\.0\.[2..254]/) {
print "IP Matched!\n";;
} else {
print "No Match!\n";
}
For a reason i don't understand:
127.0.0.1 doesn't match as expected...
Eve
10 matches
Mail list logo