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
|
try
|
||||||
{ // compile our regular expression
|
{ // compile our regular expression
|
||||||
RECompiler compiler = new RECompiler();
|
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
|
} // end try
|
||||||
catch (RESyntaxException e)
|
catch (RESyntaxException e)
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class EmoticonTagHandler implements Rewriter
|
||||||
RE r = null;
|
RE r = null;
|
||||||
try
|
try
|
||||||
{ // compile regular expression
|
{ // compile regular expression
|
||||||
r = new RE("ei:\\s*(\\w+)(?:\\s*/)?\\s*");
|
r = new RE("ei:\\s*(\\w+)(\\s*/)?\\s*");
|
||||||
|
|
||||||
} // end try
|
} // end try
|
||||||
catch (RESyntaxException e)
|
catch (RESyntaxException e)
|
||||||
|
|
|
@ -76,17 +76,17 @@ public class URLRewriter implements Rewriter
|
||||||
private static final RECompiler COMPILER = new RECompiler();
|
private static final RECompiler COMPILER = new RECompiler();
|
||||||
private static final String[] SETUP_DATA =
|
private static final String[] SETUP_DATA =
|
||||||
{
|
{
|
||||||
"^http://[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)+", "",
|
"^http://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
|
||||||
"^ftp://[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_-]+)+", "",
|
"^gopher://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
|
||||||
"^mailto:[A-Za-z0-9!#$%*+-/=?^_`{|}~.]+@[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_-]+)+$", "",
|
"^news:[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+$", "",
|
||||||
"^nntp://[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_-]+)+", "",
|
"^telnet://[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+", "",
|
||||||
"^tn3270://[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://",
|
"^www\\.[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*", "http://",
|
||||||
"^ftp\\.[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*", "ftp://",
|
"^ftp\\.[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*", "ftp://",
|
||||||
"^gopher\\.[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*", "gopher://"
|
"^gopher\\.[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*", "gopher://"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final List KNOWN_ELEMENTS;
|
private static final List KNOWN_ELEMENTS;
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class EmoticonManager
|
||||||
RE r = null;
|
RE r = null;
|
||||||
try
|
try
|
||||||
{ // create the regexp
|
{ // create the regexp
|
||||||
r = new RE("<ei:\\s*(\\w+)(?:\\s*/)?\\s*>");
|
r = new RE("<ei:\\s*(\\w+)(\\s*/)?\\s*>");
|
||||||
|
|
||||||
} // end try
|
} // end try
|
||||||
catch (RESyntaxException e)
|
catch (RESyntaxException e)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user