=~
judges if a sting is in accordance with a regular expression format.
- Expression:
<string>
=~ "<regexp>
" - Left operand: string
- Right operand: regular expression
Constant
Example: judge if String "adfAWa" is composed of uncapitalized letters.
return "adfAWa" =~ "^[a-z]+$"
Alias
Example: find 10 email addresses and judge if their formats are [email protected] or [email protected]
find().nodes({@email}) as n
limit 10
return n.address, n.address =~ "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+\.(com|cn)$"
Property
Example: find 10 email addresses whose formats are [email protected] or [email protected]
find().nodes({@email.address =~ "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+\.(com|cn)$"}) as n
limit 10
return n{*}