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; <split here> xxx $$ blah blah $$ Regexes aren't clever enough to count the number of backreferences, and so won't help in the above case. You'd be better off creating a custom parser using a stack or counter of some sort to decide whether or not to split the text. -- http://mail.python.org/mailman/listinfo/python-list