2017-03-12 17:22 GMT+01:00 :
> Hi All,
>
> I have a string which looks like
>
> a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f
> "5546,3434,345,34,34,5,34,543,7"
>
> It is comma saperated string, but some of the fields have a double quoted
> string as part of it (and t
On 2017-03-12 09:22, rahulra...@gmail.com wrote:
> a,b,c "4873898374", d, ee "3343,23,23,5,,5,45",
> f "5546,3434,345,34,34,5,34,543,7"
>
> It is comma saperated string, but some of the fields have a double
> quoted string as part of it (and that double quoted string can ha
rahulra...@gmail.com writes:
> Hi All,
>
> I have a string which looks like
>
> a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f
> "5546,3434,345,34,34,5,34,543,7"
>
> It is comma saperated string, but some of the fields have a double
> quoted string as part of it (and th
On Sun, Mar 12, 2017 at 12:22 PM, wrote:
> Hi All,
>
> I have a string which looks like
>
> a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f
> "5546,3434,345,34,34,5,34,543,7"
>
> It is comma saperated string, but some of the fields have a double quoted
> string as part
Hi All,
I have a string which looks like
a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f
"5546,3434,345,34,34,5,34,543,7"
It is comma saperated string, but some of the fields have a double quoted
string as part of it (and that double quoted string can have commas).
Ab
Giovanni Bajo wrote:
> Martin Biddiscombe wrote:
>
>
>>"parameter=12ab"
>>"parameter=12ab foo bar"
>>"parameter='12ab'"
>>"parameter='12ab' biz boz"
>>"parameter="12ab""
>>"parameter="12ab" junk"
>
>
import shlex
def extract(s):
>
> ... s = s.split("=")[1]
> ... s = shlex.split
Martin Biddiscombe wrote:
> "parameter=12ab"
> "parameter=12ab foo bar"
> "parameter='12ab'"
> "parameter='12ab' biz boz"
> "parameter="12ab""
> "parameter="12ab" junk"
>>> import shlex
>>> def extract(s):
... s = s.split("=")[1]
... s = shlex.split(s)[0]
... return s
...
>>> extract(
> "parameter=12ab"
> "parameter=12ab foo bar"
> "parameter='12ab'"
> "parameter='12ab' biz boz"
> "parameter="12ab""
> "parameter="12ab" junk"
>
> in each case returning 12ab as a match. "parameter" is known and fixed.
> The parameter value may or may not be enclosed in single or double
> quotes,
Martin Biddiscombe wrote:
> It's probably quite simple, but what I want is a regular expression
If it's simple, then you probably *dont* want a regexp.
> to
> parse strings of the form:
>
> "parameter=12ab"
> "parameter=12ab foo bar"
> "parameter='12ab'"
> "parameter='12ab' biz boz"
> "parameter
It's probably quite simple, but what I want is a regular expression to
parse strings of the form:
"parameter=12ab"
"parameter=12ab foo bar"
"parameter='12ab'"
"parameter='12ab' biz boz"
"parameter="12ab""
"parameter="12ab" junk"
in each case returning 12ab as a match. "parameter" is known and fix
10 matches
Mail list logo