On 2017-08-08 17:37, Larry Martell wrote:
Anyone have any code or know of any packages for validating a regexp?I have an app that allows users to enter regexps for db searching. When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it causes downstream issues. I'd like to flag it at entry time.
Couldn't you just try compile the regex and catch any exception? Also, in that way is 'A|B|' invalid? -- https://mail.python.org/mailman/listinfo/python-list