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