What is the Java equivalent of JavaScript\'s String.match()
String.match()
I need to get an array or a list of all matches
Example:
var str = \
String.matches(String regex) is a more direct equivalent, but only use it for one-off regexes. If you'll be using it multiple times, stick with Pattern.compile as suggested.
String.matches(String regex)
Pattern.compile