Please Explain this test case : isMatch("ab", ".*") → 1


#1

Why is this testcase giving true(1) as an output??


#2

Because * ensures that the previous character can be repeated for >= 0 times, so
".* " means “.” can be repeated 2 times such that A = “ab” and B = “…”