Package dev.yasint.regexsynth.ast
Class Literals
java.lang.Object
dev.yasint.regexsynth.ast.Literals
public final class Literals
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Literals() -
Method Summary
Modifier and Type Method Description static Expressionliteral(java.lang.String literals)Treats a given string as a literal inside the regular expression.static ExpressionquotedLiteral(java.lang.String literals)Encloses a given string in quoted literals using the regex construct \Q...\E The whole string will be treated as a string literal.static ExpressionunicodeClass(UnicodeScript block, boolean negated)Appends the given unicode block to the expression.
-
Constructor Details
-
Literals
public Literals()
-
-
Method Details
-
literal
Treats a given string as a literal inside the regular expression. All the reserved characters will be escaped using the backslash character.- Parameters:
literals- some string- Returns:
- escaped literal
-
quotedLiteral
Encloses a given string in quoted literals using the regex construct \Q...\E The whole string will be treated as a string literal.- Parameters:
literals- some string or text- Returns:
- strict quoted literal string or text
-
unicodeClass
Appends the given unicode block to the expression. It can only be one of the values from the list (https://github.com/google/re2/wiki/Syntax). And you can negate the unicode class by specifying the negated totrueorfalse.- Parameters:
block- unicode general category block / script blocknegated- whether the block is negated or not- Returns:
- unicode character block
-