--
http://mail.python.org/mailman/listinfo/python-list
Paul,
> Pyparsing ships with JPG and PNG files containing class diagrams, plus an
> htmldoc directory containing epydoc-generated help files.
> There are also about 20 example programs included (also accessible in the
> wiki).
Yes. That's what I have been missing. Maybe you could add: "please als
"GHUM" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Paul,
>
> > text = """ ... input source text ... ""
> > from pyparsing import SkipTo,Literal,replaceWith
> > ign1 = "$$" + SkipTo("$$") + "$$"
> > ign2 = "$_$" + SkipTo("$_$") + "$_$"
> > semi = Literal(";").setParseAction( replac
Paul,
> text = """ ... input source text ... ""
> from pyparsing import SkipTo,Literal,replaceWith
> ign1 = "$$" + SkipTo("$$") + "$$"
> ign2 = "$_$" + SkipTo("$_$") + "$_$"
> semi = Literal(";").setParseAction( replaceWith("; <***>") )
> print (ign1 | ign2 | semi).transformString(text)
Thank you
"GHUM" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I need to split a text at every ; (Semikolon), but not at semikolons
> which are "escaped" within a pair of $$ or $_$ signs.
>
The pyparsing rendition to this looks very similar to the SE solution,
except for the regexp's:
text
u can add as many expressions as
you want. You'd probably want to choose a more convenient split mark.
Frederic
- Original Message -
From: "GHUM" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Wednesday, August 02, 2006 5:27 PM
Subject: need help of regular express
GHUM wrote:
> I need to split a text at every ; (Semikolon), but not at semikolons
> which are "escaped" within a pair of $$ or $_$ signs.
Looking at you example SQL code, it probably isn't possible with
regexes. Consider the code:
$$
blah blah
...
$$
blah;
xxx
$$
blah
blah
$$
Regexes aren't c
I need to split a text at every ; (Semikolon), but not at semikolons
which are "escaped" within a pair of $$ or $_$ signs.
My guess was that something along this should happen withing csv.py;
but ... it is done within _csv.c :(
Example: the SQL text should be splitted at "" (of course,
those "spl