Package dev.yasint.regexsynth.dsl
Class Literals
java.lang.Object
dev.yasint.regexsynth.dsl.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 ExpressionunicodeScriptLiteral(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
-
unicodeScriptLiteral
Appends the given unicode block to the expression. It can only be one of the values from theUnicodeScript. 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
-