Mark Dilger <mark.dilger@enterprisedb.com> writes:
> Have you thought about whether If it weren't in test/modules, it might be nice to expose test_regex from SQL with a
slightlydifferent interface that doesn't throw on regex compilation error? Maybe something in contrib? It might be
usefulto some users to validate regular expressions. I'm just asking... I don't have any problem with how you have it
here.
Hm. There isn't anything about test_regex()'s API that I would want
to expose to end users ;-) ... it's just designed to replicate the
test API that Henry Spencer designed a couple decades ago, which IMO
was not too clean even by the standards of the time.
However, I can see the argument for a function along the lines of
"validate_regex(text) returns bool". If you or somebody else wants to
write that, independently of this patch, I think it'd be a fine idea.
regards, tom lane