Maybe use Text::ParseWords
poj#!perl use strict; use Text::ParseWords; while (<DATA>){ chomp; my @parts = quotewords('\s+',0,$_); print join "|",@parts,"\n"; } __DATA__ "my" "dog" "my" "dog shepherd" my dog my "dog shepherd" "my "dog" my "dog shepherd
In reply to Re: validating a quoted string
by poj
in thread validating a quoted string
by hellosarathy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |