Code executed via codepad is running in a very restricted environment:
Code execution is handled by a supervisor based on geordi. The strategy is to run everything under ptrace, with many system calls disallowed or ignored. Compilers and final executables are both executed in a chroot jail, with strict resource limits. The supervisor is written in Haskell.
While it's nothing you'd expect to break a regex engine it's very possible that the pcre library uses something internally that is blocked by the codepad environment. No production system uses such severe restrictions so you should be safe to use that code in your application.
The error code stands for "PCRE_ERROR_BADOPTION - the value of what was invalid".
However, the code in the PHP source where the error occurs is rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats);
which uses a constant for what. So it clearly means that the pcre library is broken on codepad.
If you wanted to be completely safe, you could write a small C program using libpcre to call that function on the same regex.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…