Re: Regular expression query

2017-03-12 Thread Vlastimil Brom
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

Re: Regular expression query

2017-03-12 Thread Tim Chase
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

Re: Regular expression query

2017-03-12 Thread Jussi Piitulainen
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

Re: Regular expression query

2017-03-12 Thread Larry Martell
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

Regular expression query

2017-03-12 Thread rahulrasal
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

Re: Regular expression query

2006-02-06 Thread bruno at modulix
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

Re: Regular expression query

2006-02-04 Thread Giovanni Bajo
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(

Re: Regular expression query

2006-02-03 Thread Tim Chase
> "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,

Re: Regular expression query

2006-02-03 Thread bruno at modulix
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

Regular expression query

2006-02-03 Thread Martin Biddiscombe
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