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.

Required fields*

10
  • 23
    This answer sends people in completely the wrong direction. They should never use regEx to locate regular expressions, because it cannot work correctly in all cases. See my answer added. Commented Jan 2, 2016 at 18:07
  • 3
    .{,1} is unmatched. Change to ^((?:(?:[^?+*{}()[\]\\|]+|\\.|\[(?:\^?\\.|\^[^\\]|[^\\^])(?:[^\]\\]+|\\.)*\]|\((?:\?[:=!]|\?<[=!]|\?>)?(?1)??\)|\(\?(?:R|[+-]?\d+)\))(?:(?:[?+*]|\{\d*(?:,\d*)?\})[?+]?)?|\|)*)$ matches. CHange \d+ to \d* Commented Mar 16, 2017 at 11:34
  • 7
    regex by def should not have recursion, at least say something like that in ur answer, ur regex engine is probably "too powerful" and not really a regex engine. Commented Jun 11, 2017 at 0:34
  • 2
    @vitaly-t: Where is your answer? Commented Jan 5, 2021 at 21:41
  • 3
    @PeterV.Mørch I deleted it, because oddly enough, it received many downvotes. Here, I copied my answer to a Gist. Commented Jan 6, 2021 at 1:29