Package com.networknt.schema.regex
Class RegularExpressions
java.lang.Object
com.networknt.schema.regex.RegularExpressions
Utility methods for Regular Expressions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringreplaceCharacterProperties(String regex, Map<String, String> replacements) The character properties in JDK is different from ECMA.static StringreplaceDollarAnchors(String regex) The meaning of $ in ecmascript does not allow newlines while for other languages it is typically allowed.static StringReplaces the longform character properties with the shortform character propertise.
-
Method Details
-
replaceDollarAnchors
The meaning of $ in ecmascript does not allow newlines while for other languages it is typically allowed. The closest to the meaning in ecmascript is \z.- Parameters:
regex- the regex- Returns:
- the replacement
-
replaceLongformCharacterProperties
Replaces the longform character properties with the shortform character propertise.- Parameters:
regex- the regex- Returns:
- the replacement
-
replaceCharacterProperties
The character properties in JDK is different from ECMA.- Parameters:
regex- the regex- Returns:
- the replacement
-