Regexp that matches valid regexps

前端 未结 7 1181
北荒
北荒 2020-12-03 02:38

Is there a regular expression that matches valid regular expressions?

(I know there are several flavors of regexps. One would do.)

7条回答
  •  感动是毒
    2020-12-03 03:18

    Unfortunately, most invalid regular expressions are invalid due to parentheses nesting errors. This is exactly the type of strings that regular expressions can't match. (Okay, some fancy regular expression systems have recursion extensions, but that's rare)

提交回复
热议问题