Jakarta Regexp 1.4 apparently doesn't like the (?:...) noncapturing

group syntax...I really ought to rewrite this using JDK1.4+ regexps,
but for now we kludge it
This commit is contained in:
Eric J. Bowersox 2006-02-09 04:19:56 +00:00
parent 75f8e8f44f
commit 74787e4902
4 changed files with 14 additions and 14 deletions

View File

@ -85,7 +85,7 @@ public class EmailRewriter implements Rewriter
try
{ // compile our regular expression
RECompiler compiler = new RECompiler();
s_match = compiler.compile("^[A-Za-z0-9!#$%*+-/=?^_`{|}~.]+@[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+$");
s_match = compiler.compile("^[A-Za-z0-9!#$%*+\\-/=?^_`{|}~\\.]+@[A-Za-z0-9_\\-]+(\\.[A-Za-z0-9_\\-]+)+$");
} // end try
catch (RESyntaxException e)

View File

@ -94,7 +94,7 @@ public class EmoticonTagHandler implements Rewriter
RE r = null;
try
{ // compile regular expression
r = new RE("ei:\\s*(\\w+)(?:\\s*/)?\\s*");
r = new RE("ei:\\s*(\\w+)(\\s*/)?\\s*");
} // end try
catch (RESyntaxException e)

View File

@ -76,17 +76,17 @@ public class URLRewriter implements Rewriter
private static final RECompiler COMPILER = new RECompiler();
private static final String[] SETUP_DATA =
{
"^http://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
"^ftp://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
"^gopher://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
"^mailto:[A-Za-z0-9!#$%*+-/=?^_`{|}~.]+@[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+$", "",
"^news:[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+$", "",
"^nntp://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
"^telnet://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
"^tn3270://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
"^www\\.[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*", "http://",
"^ftp\\.[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*", "ftp://",
"^gopher\\.[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*", "gopher://"
"^http://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
"^ftp://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
"^gopher://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
"^mailto:[A-Za-z0-9!#$%*+-/=?^_`{|}~.]+@[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+$", "",
"^news:[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+$", "",
"^nntp://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
"^telnet://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
"^tn3270://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
"^www\\.[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*", "http://",
"^ftp\\.[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*", "ftp://",
"^gopher\\.[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*", "gopher://"
};
private static final List KNOWN_ELEMENTS;

View File

@ -152,7 +152,7 @@ public class EmoticonManager
RE r = null;
try
{ // create the regexp
r = new RE("<ei:\\s*(\\w+)(?:\\s*/)?\\s*>");
r = new RE("<ei:\\s*(\\w+)(\\s*/)?\\s*>");
} // end try
catch (RESyntaxException e)