import java.util.regex.*;
class Regex1{
public static void main(String args[]) {
String content="For my money, the important thing "+"about the meeting was bridge-building";
String regEx="a|f"; //表示a或f
Pattern p=Pattern.compile(regEx);
Matcher propsMatcher=p.matcher(content);
while(m.find()){
int startIndex = propsMatcher.start(); // index of start
int endIndex = propsMatcher.end(); // index of end + 1
// retrieve the matching substring
String currentMatch = content.substring(startIndex, endIndex);
System.out.println(currentMatch);
}
}
}