Re: need help of regular expression genius

2006-08-03 Thread GHUM
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

Re: need help of regular expression genius

2006-08-03 Thread Paul McGuire
"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

Re: need help of regular expression genius

2006-08-03 Thread GHUM
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

Re: need help of regular expression genius

2006-08-02 Thread Paul McGuire
"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

Re: need help of regular expression genius

2006-08-02 Thread Anthra Norell
Harald, This works. 's' is your SQL sample. >>> import SE # From the Cheese Shop with a good manual >>> Split_Marker = SE.SE (' ";=\" "~\$_?\$(.|\n)*?\$_?\$~==" ') >>> s_with_split_marks = Split_Marker (s) >>> s_split = s_with_split_marks.split ('') That's it! And it isn't as complicated as

Re: need help of regular expression genius

2006-08-02 Thread Ant
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