Can we use Java String matches() function?


  • 0
    Y

    Hi:

    Java String class has this matches() method. A quick way to solve this problem would be

    return s.matches(p).


  • 0
    Y

    I don't think so. You have to know the mechanism of regular expression matching.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.