mongoRegExpNew

Creates a BSON regular expression value. Use it in a query filter to match string fields against a pattern, or store it in a document.

mongoRegExpNew(pattern [, options]) → returns any

This function requires Adobe ColdFusion 2021 and up.  Not supported on Lucee, etc.

Argument Reference

pattern string
Required

The regular expression pattern.

options string

Regular expression option flags, such as i for a case-insensitive match.

Compatibility

ColdFusion:

Version 2021+ Requires the mongodb package.

Examples
Sample code invoking the mongoRegExpNew function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub