Do we, anywhere, use this function to test "is this alleged regex actually well-formed ?" ?  Hopefully not - we should delegate that question to the PCRE library.  Speaking of which, why isn't this test delegated to the library ?

There should be documentation explaining what this function is really for, answering the questions above in particular.