in reply to Help with Metacharacters syntax

With disclaimers about matching general email addresses, the first problem is solved when you realize you want the regex to stop matching on whitespace. You have .* there which matches all of anything. Try this,

if (/(abuse\@\S*)/) { # ... }

For the second problem, you want quantifiers,

if (/(Net-\d{1,3)-\d{1,3)-\d{1,3)-0-1)/) { # ... }
See perlre and perlretut, which you can view locally with perldoc.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Help with Metacharacters syntax
by JJB (Novice) on Jun 20, 2004 at 14:53 UTC
    some of the email address are not surrounded by white space. <abuse#tel2.it> or abuse#tel2.it or \abuse#tel2.it\ I need to be able to capture email address that are either surrounded by space or enclosed with special characters but have the special characters dropped.