RegexMatch constructor

RegexMatch({
  1. @required dynamic input,
  2. @required dynamic regex,
  3. dynamic options,
})

Creates $regexMatch operator expression

Performs a regular expression (regex) pattern matching and returns:

  • true if a match exists.
  • false if a match doesn’t exist.

MongoDB uses Perl compatible regular expressions (i.e. “PCRE” ) version 8.41 with UTF-8 support.

  • input - The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string.
  • regex - The regex pattern to apply. Can be any valid expression that resolves to a string.
  • options - Optional. The following

Implementation

RegexMatch({@required input, @required regex, options})
    : super('regexMatch',
          AEObject({'input': input, 'regex': regex, 'options': options}));