Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.1Addons
-
None
-
None
-
Eclipse Kepler on Mac OS 10.9.2 running Java 7
Description
Regex Annotator cannot replace variables which value contain $.
Caused by: java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:808)
at java.util.regex.Matcher.replaceAll(Matcher.java:906)
at java.lang.String.replaceAll(String.java:2162)
at org.apache.uima.annotator.regex.impl.Rule_impl.replaceRegexVariables(Rule_impl.java:371)
at org.apache.uima.annotator.regex.impl.Rule_impl.initialize(Rule_impl.java:285)
Sample variable:
<variable name="dollar" value="US\$|USD" />
Caused by the code escaping backslashes without escaping dollar sign in ConceptFileParser_impl.java:103 and then later used directly as replacement value in Rule_impl.java:371, causing the dollar sign to be interpreted as start of group reference, hence the "Illegal group reference" error.