linear custom file type keyword parser

This commit is contained in:
peter
2012-01-10 18:00:24 +01:00
parent 62353d99e5
commit 0ff6027cf3
@@ -49,7 +49,7 @@ public class KeywordParser extends TokenParser {
}
Pattern pattern = null;
try {
pattern = Pattern.compile("(" + regex + ")($|[\\W].*)", (ignoreCase ? Pattern.CASE_INSENSITIVE : 0) | Pattern.DOTALL);
pattern = Pattern.compile("(" + regex + ")($|[\\W])", (ignoreCase ? Pattern.CASE_INSENSITIVE : 0) | Pattern.DOTALL);
}
catch (PatternSyntaxException e) {
LOG.error(e);
@@ -75,7 +75,7 @@ public class KeywordParser extends TokenParser {
}
Matcher matcher = myPattern.matcher(myBuffer.subSequence(position, myBuffer.length()));
if (!matcher.matches()) {
if (!matcher.lookingAt()) {
return false;
}