return find(text, regEx, true);
}
private static List<RegExMatch> find(String text, String regEx, boolean isUrlMap) throws DotRuntimeException{
RegEX i = getInstance();
Perl5Matcher matcher = i.localP5Matcher.get();
Pattern pattern;
try {
pattern = i.getPattern(regEx);
} catch (MalformedPatternException e) {
Logger.error(RegEX.class, "Unable to compile pattern for regex", e);
throw new DotRuntimeException("Unable to compile pattern for regex",e);
}
List<RegExMatch> res = new ArrayList<RegExMatch>();
MatchResult result;
PatternMatcherInput input = new PatternMatcherInput(text);
while (matcher.contains(input, pattern)) {
RegExMatch rm = new RegExMatch();
result = matcher.getMatch();
if(!isUrlMap || result.beginOffset(0) == 0){
rm.setMatch(result.group(0));
rm.setBegin(result.beginOffset(0));
rm.setEnd(result.endOffset(0));
List<RegExMatch> r = new ArrayList<RegExMatch>();