How to determine if a regex is orthogonal to another regex?

后端 未结 13 540
余生分开走
余生分开走 2020-12-13 16:40

I guess my question is best explained with an (simplified) example.

Regex 1:

^\\d+_[a-z]+$

Regex 2:

^\\d*$
<         


        
13条回答
  •  不思量自难忘°
    2020-12-13 16:52

    Proving that one regular expression is orthogonal to another can be trivial in some cases, such as mutually exclusive character groups in the same locations. For any but the simplest regular expressions this is a nontrivial problem. For serious expressions, with groups and backreferences, I would go so far as to say that this may be impossible.

提交回复
热议问题