Help for this page

Select Code to Download


  1. or download this
    perl -wle'@list = grep defined && length, split /(?:(?<!\S)"([^"]*)"(?
    +!\S))|\s+/, shift;print for @list' 'one "two three" four "five"'
    
  2. or download this
    perl -wle'@list = grep defined, split /(?:(?<!\S)"([^"]*)"(?!\S))|\s+/
    +, shift;print for @list' 'one "two three" four "five"'