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:
parent
75f8e8f44f
commit
74787e4902
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user