Path: utzoo!attcan!uunet!snorkelwacker!usc!rutgers!mcnc!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Quoting and Splitting Message-ID: <1990Sep26.125033.19670@uvaarpa.Virginia.EDU> Date: 26 Sep 90 12:50:33 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 25 From: hakanson@ogicse.ogi.edu (Marion Hakanson) This has been discussed several times before. If you allow the quotes to be escaped (with a backslash, which can also be escaped by a backslash, etc.), then you aren't going to be able to do this with a regular expression. Even if you don't, the r.e. will be ugly. Say what? Write: escaped-char = \\. non-escaped-char = [^\\"] (I think Perl requires \ inside of [] to be quoted now.) inside-quote-char = escaped-char | non-escaped-char quoted-string = " inside-quote-char* " All together: /"(\\.|[^\\"])*"/ The only thing you can't do with regexps is recursively embedded structures. Dale Worley Compass, Inc. worley@compass.com -- Generally speaking, the Way of the warrior is resolute acceptance of death. -- Miyamoto Musashi, 1645