On Sat, 8 Apr 2000, Michael J. Maravillo wrote:
|o| > What's the best hack to parse a comma-delimited row of double-quotes
|o| > enclosed strings in Perl?
|o|
|o| How about...
|o|
|o| while (<>) {
|o| my @a = /"(.*?)",?/g;
|o| print join(':', @a), "\n";
|o| }
It doesn't really catch escaped double-quotes, does it?
Oh ... and what does (.*?) mean?
Anyway, I found a solution. It's not a quick hack, but who cares? I just
used the Text::CSV module. Did wonders for me. Thanks for the reply.
L L Richi Plana 8^) ,-,-. ,-,-. ,-,-. ,-,-. ,-
LL LL Systems Administrator / / \ \ / / \ \ / / \ \ / / \ \ / /
LLLLL Mosaic Communications, Inc. \ \ / / \ \ / / \ \ / / \ \ / /
LLLLL mailto:[EMAIL PROTECTED] `-'-' `-'-' `-'-' `-'-'
-
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]