Hans-Christoph Steiner wrote:
So... anyone want to write a regexp that escapes any unclosed
brackets? That would be a tricky one... but very useful for Pd.
I guess that it's not possible at all with regular expressions:
http://en.wikipedia.org/wiki/Regular_language#Regular_languages_over_an_alph... --8<-- A simple example of a language that is not regular is the set of strings { a^n b^n | n >= 0 }. --8<--
This is precisely the "matching brackets" problem.