Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: using regular expressions showing just the hits.

by choroba (Chancellor)
on Apr 05, 2013 at 14:52 UTC ( #1027147=note: print w/replies, xml ) Need Help??

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 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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027147]
NodeReaper wonders through a maze of twisty little sayings, all different

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-09-24 06:11 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (273 votes). Check out past polls.