Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Regex match for Any number of words?

by kcott (Archbishop)
on Jan 16, 2022 at 11:40 UTC ( [id://11140501]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -E 'say for split /\W+/, " THIS is a variable number of words, 
    +spaces  and  punctuation. "'
    
    ...
    spaces
    and
    punctuation
    
  2. or download this
    $ perl -E 'say for split /[ ,.]+/, " THIS is a variable number of word
    +s, spaces  and  punctuation. " =~ s/^[ ,.]*//r'
    THIS
    ...
    spaces
    and
    punctuation
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-26 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found