Package com.networknt.schema.regex
Class RegularExpressions
- java.lang.Object
-
- com.networknt.schema.regex.RegularExpressions
-
public class RegularExpressions extends Object
Utility methods for Regular Expressions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 StringreplaceLongformCharacterProperties(String regex)Replaces the longform character properties with the shortform character propertise.
-
-
-
Method Detail
-
replaceDollarAnchors
public static String replaceDollarAnchors(String regex)
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
public static String replaceLongformCharacterProperties(String regex)
Replaces the longform character properties with the shortform character propertise.- Parameters:
regex- the regex- Returns:
- the replacement
-
-