On Jan 7, Ken Yeo said: >What is the best pattern matching for ip addresses? I tried $var =~ >/\b\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3}\s/ but the {1-3} didn't work, please
You want {1,3}, not {1-3}. Also, should that \s be a \b? And be warned that the number 500 matches /\d{1-3}/ without being "legal" for an IP address. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]