Re: Quote-aware string splitting
- From: "George Sakkis" <gsakkis@xxxxxxxxxxx>
- Date: 25 Apr 2005 19:45:30 -0700
> import re
> regex = re.compile(r'''
> '.*?' | # single quoted substring
> ".*?" | # double quoted substring
> \S+ # all the rest
> ''', re.VERBOSE)
Oh, and if your strings may span more than one line, replace re.VERBOSE
with re.VERBOSE | re.DOTALL.
George
.
- References:
- Quote-aware string splitting
- From: J. W. McCall
- Re: Quote-aware string splitting
- From: Tim Heaney
- Re: Quote-aware string splitting
- From: George Sakkis
- Quote-aware string splitting
- Prev by Date: Re: Quote-aware string splitting
- Next by Date: Import DiscID on Windows
- Previous by thread: Re: Quote-aware string splitting
- Next by thread: Re: Quote-aware string splitting
- Index(es):
Relevant Pages
|