I am comparing two lists of strings to find possible matches. Example:
public class Tester { public static void main(String[] args) { List
Instead of
s.matches(".*" + s2 + ".*")
you can use
s.contains(s2)
or
s.indexOf(s2) > -1
I tested both, each is about 35x faster than matches.
matches