Wolfgang Ndasi-Donner wrote:

> > .... Btw, can't that regular expression be simplified a bit?  The
> > two * could be turned into a single ? and the [^()] can be turned
> > into [^(] and [^)], or?

> It depends on the definition of 'balanced' needed. If [^(] is used the
> string 'abcde(fgh' will be recognized as balanced.

I assume you mean 'abcde)fgh'.

> The two * are necessary if one needs to match balanced strings,
> independant of its structure, e.g.  'abvv(d(jhj)kjj)hd(jhb(j))hdjh'.
> This form has an advantage too. it is related to Friedl's loop
> enrolling structure "<normal>(<special><normal>*)*' and avoids endless
> matching.

Hm, yes that's true,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}