Repository: incubator-streams Updated Branches: refs/heads/master e68300936 -> a1b02094e
Added new test cases Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/4ae10fd3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/4ae10fd3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/4ae10fd3 Branch: refs/heads/master Commit: 4ae10fd3abdd2694d15fb102286cfc94931eacb2 Parents: 124e01e Author: mfranklin <[email protected]> Authored: Tue May 13 12:26:58 2014 -0400 Committer: mfranklin <[email protected]> Committed: Wed May 14 11:31:09 2014 -0400 ---------------------------------------------------------------------- .../src/main/java/org/apache/streams/regex/RegexUtils.java | 2 +- .../src/test/java/org/apache/streams/regex/RegexUtilsTest.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/4ae10fd3/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/RegexUtils.java ---------------------------------------------------------------------- diff --git a/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/RegexUtils.java b/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/RegexUtils.java index bf5c03a..41c3ee5 100644 --- a/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/RegexUtils.java +++ b/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/RegexUtils.java @@ -52,7 +52,7 @@ public class RegexUtils { * @return a non-null list of matches. */ public static List<String> extractWordMatches(String pattern, String content) { - pattern = "(^|\\s)(" + pattern + ")([\\s!\\.;,]|$)"; + pattern = "(^|\\s)(" + pattern + ")([\\s!\\.;,?]|$)"; return getMatches(pattern, content, 2); } http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/4ae10fd3/streams-contrib/streams-processor-regex/src/test/java/org/apache/streams/regex/RegexUtilsTest.java ---------------------------------------------------------------------- diff --git a/streams-contrib/streams-processor-regex/src/test/java/org/apache/streams/regex/RegexUtilsTest.java b/streams-contrib/streams-processor-regex/src/test/java/org/apache/streams/regex/RegexUtilsTest.java index 7dad4ca..eed1327 100644 --- a/streams-contrib/streams-processor-regex/src/test/java/org/apache/streams/regex/RegexUtilsTest.java +++ b/streams-contrib/streams-processor-regex/src/test/java/org/apache/streams/regex/RegexUtilsTest.java @@ -56,7 +56,9 @@ public class RegexUtilsTest { {"#\\w+", "This is #freakingcrazydude.", 1, 1}, {"#\\w+", "This is #freakingcrazydude!", 1, 1}, {"#\\w+", "This is #freakingcrazydude I went to the moon", 1, 1}, - {"#\\w+", "This is #freakingcrazydude I went to the #freakingcrazydude party", 2, 2}, + {"#\\w+", "This is #freakingcrazydude I went to the #freakingcrazydude? party", 2, 2}, + {"#\\w+", "This is #freakingcrazydude I went to the #freakingcrazydude; party", 2, 2}, + {"#\\w+", "This is #freakingcrazydude I went to the #freakingcrazydude, party", 2, 2}, {"#\\w+", "This is#freakingcrazydude I went to the #freakingcrazydude party", 2, 1}, {"#\\w+", "#what does the fox say?", 1, 1}, {"#\\w+", "#what does the fox #say", 2, 2}
