[Solved] Why does a*ad$ match the string “ad”? [duplicate]
Shouldn’t the a* match with the a in the string? No, because * means a can match zero or more times, so the ” empty string also matches that expression. That leaves ‘ad’ after the initial empty string to match for the remainder of the expression. A regex will consider both options here (both ”, … Read more