in reply to phrase and word searching
sub split_text { $_[0] =~ /("[^"]*"|[^\s"]+)/g; } my $text = 'The dog said "Hi, how are you?" I laughed.'; my @pieces = split_text($text); print "$_\n" for @pieces; __END__ The dog said "Hi, how are you?" I laughed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: phrase and word searching
by ManyCrows (Novice) on Jun 01, 2001 at 01:52 UTC |