Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    This is just a wrapper around preg_last_error specific for the English language. Commented Oct 22, 2012 at 20:39
  • By the way, this will not really tell you if regex is valid or not. Consider this: php > preg_match("/aaa",""); php > echo preg_last_error(); 0 Commented Oct 6, 2013 at 5:41
  • PHP 7 added PREG_JIT_STACKLIMIT_ERROR. See the docs. Commented Apr 1, 2019 at 21:11