// regExp (?=.*我是谁)(?=.*C)^.*$
// java code
Listlist = Arrays.asList(new String[]{
"我是谁我是A",
"我是谁我是B",
"我是谁我是C"
});
Listmatches = new ArrayList ();
for(String word : list){
//包含我是谁且包含C
if(word.matches("(?=.*我是谁)(?=.*C)^.*$"))
matches.add(word);
}
System.out.println(Arrays.toString(matches.toArray()));