when does Regex("1+2") (or "(1)+2" )fail to match ...
# announcements
j
when does Regex("1+2") (or "(1)+2" )fail to match "12" ?
w
Copy code
@Test
    fun asas() {
        assertTrue(Regex("(1)+2").matches("12"))
    }
Here it is “matching”.
j
i found the answer to my question. it is not visible in the debugger. Regex.fromLiteral() is the source of pattern above. something about the Regex object state executes the pattern differently
👍 1