Java String class has this matches() method. A quick way to solve this problem would be
I don't think so. You have to know the mechanism of regular expression matching.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.