Class RegularExpressions
Object
RegularExpressions
A class to verify that input conforms to certain regular expressions. Also
contains constants for Regular Expressions used in the validation of the
entities.
- Author:
- maartenl
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkRegexp
(String regexp, String value, String message) Checks if the value matches the regular expressionstatic boolean
regExpTest
(String regexp, String matches)
-
Field Details
-
NAME_REGEXP
- See Also:
-
NAME_MESSAGE
- See Also:
-
URL_REGEXP
- See Also:
-
URL_MESSAGE
- See Also:
-
ONLY_LETTERS_ONE_OR_MORE_REGEXP
- See Also:
-
ONLY_LETTERS_ONE_OR_MORE_MESSAGE
- See Also:
-
ONLY_LETTERS_REGEXP
- See Also:
-
ONLY_LETTERS_MESSAGE
- See Also:
-
COMMENTS_REGEXP
- See Also:
-
COMMENTS_MESSAGE
- See Also:
-
WIKIPAGE_TITLE_REGEXP
- See Also:
-
WIKIPAGE_TITLE_MESSAGE
- See Also:
-
-
Method Details
-
checkRegexp
public static void checkRegexp(String regexp, String value, String message) throws RegularExpressionException Checks if the value matches the regular expression- Parameters:
regexp
- the regular expressionvalue
- the value to verifymessage
- a message to display if the regular expression does not check out. May be null, in which case the message becomes something generic like "value x should match regexp y.- Throws:
RegularExpressionException
- a checked exception indicating failure.
-
regExpTest
-