Brackets in brackets, braces in braces

Dale Strickland-Clark dale at riverhall.NOTHANKS.co.uk
Tue Apr 16 15:21:05 EDT 2002


ahorvath at szgti.bmf.hu (Horvath, Arpad) wrote:

>How can I find strings like this with regular expressions:\something
>[something1] {something2} {something3}Where in the braces can be also
>another braces. For example:\frac{1\times10^{-16}}{4}   can be at the
>place, where something2 is.(braces in pairs)\interval [J]
>{\frac{1\times10^{-16}}{4}} {1..5}My half solution is at
>www.szgti.bmf.hu/~ahorvath/regexp.txt.

You can't do it with re but, if I recall correctly, someone posted a
link to a class based on SPITBOL/SNOBOL's pattern matching engine a
little while ago.

That would have no trouble with nested structures.

--
Dale Strickland-Clark
Riverhall Systems Ltd




More information about the Python-list mailing list