http://www.perlmonks.org?node_id=889747


in reply to Re^2: Parsing a string
in thread Parsing a string

Be aware that the given regular expression has a chance to be broken in some circumstances.

Example:

$s = q[ci,14938340,2,"Monday, February 21, 2011 19:58:06 UTC",34.6953, +-118.5350,2.2,17.40, 9,"Southern California, \"US\""]; print for $s =~ m[("[^"]+"|[^,]+)(?:,|$)]g;

Output

ci 14938340 2 "Monday, February 21, 2011 19:58:06 UTC" 34.6953 -118.5350 2.2 17.40 9 "Southern California \"US\""
--
Regards
- Samar