The preg_last_error function is used to return the error code generated by the last PCRE regular execution.
int preg_last_error ( void )
The execution result is as follows:
Backtrack limit was exhausted!
PREG_NO_ERROR
PREG_INTERNAL_ERROR
PREG_BACKTRACK_LIMIT_ERROR
PREG_RECURSION_LIMIT_ERROR
PREG_BAD_UTF8_ERROR
PREG_BAD_UTF8_OFFSET_ERROR
Detailed parameter descriptions can be found at: PHP Regular Expression (PCRE)