# Poco::MongoDB

# class RegularExpression

Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/RegularExpression.h

## Description

Represents a regular expression in BSON format.

## Member Summary

Member Functions: createRE, getOptions, getPattern, operator =, setOptions, setPattern

## Types Aliases

### Ptr

using Ptr = SharedPtr < RegularExpression >;

## Constructors

### RegularExpression

RegularExpression();

Creates an empty RegularExpression.

### RegularExpression

RegularExpression(
const RegularExpression & copy
) = default;

Creates a RegularExpression by copying another one.

### RegularExpression

RegularExpression(
RegularExpression && other
) noexcept = default;

Creates a RegularExpression by moving another one.

### RegularExpression

RegularExpression(
const std::string & pattern,
const std::string & options
);

Creates a RegularExpression using the given pattern and options.

### RegularExpression

RegularExpression(
std::string && pattern,
std::string && options
);

Creates a RegularExpression using the given pattern and options (move semantics).

## Destructor

### ~RegularExpression

virtual ~RegularExpression();

Destroys the RegularExpression.

## Member Functions

### createRE

[[nodiscard]]
SharedPtr < Poco::RegularExpression > createRE() const;

Tries to create a Poco::RegularExpression from the MongoDB regular expression.

### getOptions

[[nodiscard]]
const std::string & getOptions() const noexcept;

Returns the options string.

### getPattern

[[nodiscard]]
const std::string & getPattern() const noexcept;

Returns the pattern.

### operator =

RegularExpression & operator = (
const RegularExpression & copy
) = default;

Assigns another RegularExpression.

### operator =

RegularExpression & operator = (
RegularExpression && other
) noexcept = default;

Move-assigns another RegularExpression.

### setOptions

void setOptions(
const std::string & options
);

Sets the options string.

### setOptions

void setOptions(
std::string && options
) noexcept;

Sets the options string (move semantics).

### setPattern

void setPattern(
const std::string & pattern
);

Sets the pattern.

### setPattern

void setPattern(
std::string && pattern
) noexcept;

Sets the pattern (move semantics).