Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: extracting words with certain characters

by rjt (Deacon)
on Dec 04, 2012 at 11:24 UTC ( #1007065=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    use Benchmark qw/:all/;
    ...
    
    my @words = $code =~ /_[\w_]* | [a-zA-Z]\w*_\w*/gx;
    print "\nWords: ", join(', ', @words);
    
  2. or download this
                Rate split  grep regex
    split 10581141/s    --  -22%  -49%
    grep  13630260/s   29%    --  -34%
    regex 20760455/s   96%   52%    --
    
    Words: is_, _be, some_sample, __code, __0K__, _, _, _
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2014-12-19 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (91 votes), past polls