Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: using regular expressions showing just the hits.

by choroba (Canon)
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
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

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 rifling through the Monastery: (5)
As of 2015-07-30 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls