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

Really nice :) Thanks - it's a wonderul solution and its module independent; I don't have the mentioned module in my webserver (do you believe that???) Kind regards, Kepler

Replies are listed 'Best First'.
Re^3: Parsing a string
by samarzone (Pilgrim) on Feb 23, 2011 at 07:17 UTC

    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