### Question:
RegexSelector implements Selector { @Override public String select(String text) { return selectGroup(text).get(group); } RegexSelector(String regexStr);  RegexSelector(String regexStr, int group); @Override String select(String text); @Override List<String> selectList(String text); RegexResult selectGroup(String text); List<RegexResult> selectGroupList(String text); @Override String toString();  }### Answer:
@Test public void test_select() throws Exception { String regex = "\\(.+"; String hello = "(hello world"; RegexSelector regexSelector = new RegexSelector(regex); String reslt = regexSelector.select(hello); System.out.println(reslt); }
@Test public void test_select_regex() throws Exception { String regex = "^.*(?=\\?)(?!\\?yy)"; String source = "hello world?xx?yy"; RegexSelector regexSelector = new RegexSelector(regex); String select = regexSelector.select(source); System.out.println(select); regex = "\\d{3}(?!\\d)"; source = "123456asdf"; regexSelector = new RegexSelector(regex); select = regexSelector.select(source); System.out.println(select); }