Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: using regular expressions showing just the hits.

by choroba (Abbot)
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"; }
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: using regular expressions showing just the hits.
Select or Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-12-28 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls