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

Re: extracting words with certain characters

by rjt (Curate)
on Dec 04, 2012 at 11:24 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1007065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found