I am comparing two lists of strings to find possible matches. Example:
public class Tester {
public static void main(String[] args) {
List
I think that you shouldn't use regex for that: I believe that looking into String#contains (here is a link to its javadoc entry) would give you better results, in terms of performance ;)
For example, your code could be:
for(final String s2: test2){
for (final String s: test){
if(s.contains(s2)) {
System.out.println("Match");
}
}
}