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

后端 未结 13 527
余生分开走
余生分开走 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 17:09

    Excellent point on the \1, \2 bit... that's context free, and so not solvable. Minor point: Not EVERYTHING is reducible to Halt... Program Equivalence for example.. – Brian Postow

    [I'm replying to a comment]

    IIRC, a^n b^m a^n b^m is not context free, and so (a\*)(b\*)\1\2 isn't either since it's the same. ISTR { ww | w ∈ L } not being "nice" even if L is "nice", for nice being one of regular, context-free.

    I modify my statement: everything in RE is reducible to the halting problem ;-)

提交回复
热议问题