Package dev.yasint.regexsynth.util
Class Common
java.lang.Object
dev.yasint.regexsynth.util.Common
public final class Common
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Common() -
Method Summary
Modifier and Type Method Description static java.lang.StringasRegexGroupName(java.lang.String name)This method checks whether a string qualifies to be a regex named capture group.static java.lang.StringasRegexLiteral(java.lang.String someString)Escapes all the special regex constructs.static booleanisNotASetExpression(Expression target)static inttoCodepoint(java.lang.String character)Converts a given character to its codepoint value.
-
Constructor Details
-
Common
public Common()
-
-
Method Details
-
asRegexLiteral
public static java.lang.String asRegexLiteral(java.lang.String someString)Escapes all the special regex constructs.VALID_GROUP_NAMEi.e.https://will transform tohttps:\/\/- Parameters:
someString- string to escape- Returns:
- escaped strings
-
asRegexGroupName
public static java.lang.String asRegexGroupName(java.lang.String name)This method checks whether a string qualifies to be a regex named capture group. It's same as source code variable declarations.- Parameters:
name- capture group name- Returns:
- the same string if it's valid
-
toCodepoint
public static int toCodepoint(java.lang.String character)Converts a given character to its codepoint value. If the the character is an empty string the min value (NULL) will be returned.- Parameters:
character- as a string (supplementary/bmp) char- Returns:
- codepoint or NULL
-
isNotASetExpression
-