On Sat, Jun 23, 2012 at 5:55 AM, Glenn Fowler <g...@research.att.com> wrote: [snip] > if the pattern did have a syntax error regcomp() would report it to the caller > so reporting an error or not is not a regex issue
I know... see below... > so it doesn't make sense to add something to ~(...) to check syntax > because regcomp() already does it by default (modulo the ast REG_LENIENT > flag, which > is settable in ~(...)) ... the point was that it would be very very useful if ksh93 would generate diagnostic messages like $ grep --strict ... # does for (half-)broken patterns in s=${x//~(E)pattern/x} or [[ $x ==~(E)pattern ]]. One idea was to use an unused letter or symbol in ~(<modifer>) and use it from the shell side. Or have a global option (set -o patterndiag) or global variable... IMHO we need such a kind of diagnostic messages... as the case with the XML fragment parser showed it can be a horrible pain to find bugs there and any help in form of error messages returned from the regex engine would've saved us *DAYS* of digging around. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.ma...@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list ast-developers@research.att.com https://mailman.research.att.com/mailman/listinfo/ast-developers