my @words= $string =~ /'[^']*'|\S+/g; my @words= $string =~ /'(?:\\.|[^\\']+)*'|\S+/gs; my @words= $string =~ /'(?:''|[^']+)*'|\S+/g;
- tye
In reply to Re: regex to split on ' ', but skip spaces inside quotes (3WTDI)
by tye
in thread regex to split on ' ', but skip spaces inside quotes
by true_atlantis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |