ContainsStrRegex

Copied!
( value, pattern )

Description

The ContainsStrRegex function returns true when the value string matches the pattern regular expression, or false when it does not.

Parameters

Parameter Type Definition and Requirements

value

The string to compare.

pattern

The regular expression to match within value.

Returns

Returns a Boolean: true when value matches the pattern regular expression, or false when it does not.

Examples

The following query demonstrates the case where the value string matches the pattern regular expression:

Copied!
('Fauna', '(Fa|na)')
true
Query metrics:
  •    bytesIn:  48

  •   bytesOut:  17

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 3ms

  •    retries:   0

The following query demonstrates the case where the value string does not match the pattern regular expression:

Copied!
('Fauna', '.Faa*')
false
Query metrics:
  •    bytesIn:  46

  •   bytesOut:  18

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 3ms

  •    retries:   0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!