Skip to main content

$$test

Checks if a string matches a certain pattern

Usage​

{ 
"$$test": /* String to test */,
"pattern": /* string */
}
"$$test(<pattern>):{input}"

Returns​

boolean

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimarystringYesString to test
patternstringYesRegular expression to match against input string

Examples​

Input

Definition

Output

"hello"
"$$test([le]):$"
true
"hello"
"$$test(hell):$"
true
"hello"
"$$test(hello$):$"
true
"hello"
"$$test(hell$):$"
false
"hello"
"$$test('^hello$'):$"
true
"hello"
"$$test('^(hello|world)$'):$"
true
"HELLO"
"$$test('^hello$'):$"
false
"HELLO"
"$$test('(?i)^hello$'):$"
true