http://www.perlmonks.org?node_id=1027147


in reply to using regular expressions showing just the hits.

\D+ stands for "non-digit repeated". You want "alphanumeric repeated", so try
while ( /([[:alnum:]]+)(\@dh\.nl)/g ) { my ($name, $domain) = ($1, $2); print "$name$domain\n"; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: using regular expressions showing just the hits.
by fritsimeel (Initiate) on Apr 05, 2013 at 15:13 UTC
    Hello Choroba, thanks for the quick reaction.

    When i run your code i get this message: Use of uninitialized value $_ in pattern match (m//) at dh.pl in line 8

    Sorry, i'm overlooking something....
      The code shown should replace the if part in the original code.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        Many thanks, that works!
        Chuck Norris voids warranties