String RegexExtract(String expression, String regex, int match_index)
expression
source string
regex
regular expression
match_index
index of the group to extract
extracted group, if fail, return null
64656667686970717273747576
t3.set(0, null); t3.set(1, "^\\/search\\/iy\\/(.*?)\\/.*"); t3.set(2, 2); RegexExtract func = new RegexExtract(); String r = func.exec(t1); assertTrue(r.equals("term1")); r = func.exec(t2); assertTrue(r==null); r = func.exec(t3); assertTrue(r==null); }
67686970717273747576777879