Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!cs.utexas.edu!cse!texas!harrison From: harrison@csl.dl.nec.com (Mark Harrison) Newsgroups: comp.lang.perl Subject: split newbee question Message-ID: <1991May2.030729.14876@csl.dl.nec.com> Date: 2 May 91 03:07:29 GMT Organization: NEC America, C & C Software Development Laboratory Lines: 20 I would like to split fields on a line, following these constraints: 1. Fields are whitespace separated words. This is what I am doing now, with split("[ \t]+"). (Can be "optimized" to just "split"? 2. Fields can have embedded whitespace if in quotes: first.field "second field" third-field 3. Field can be double quoted, double quotes can appear in field if preceded by backslash: "one \"field\" with quotes" Any hints appreciated... -- Mark Harrison | Note: harrison@ssd.dl.nec.com and harrison@csl.dl.nec.com | necssd!harrison are not operating at (214)518-5050 | present. Please forward mail through the | above address. Sorry for the inconvenience.