---
name: "bson_iter_regex"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_iter_regex"
---

# bson\_iter\_regex(3)

## SYNOPSIS

```
const char *
bson_iter_regex (const bson_iter_t *iter, const char **options);
```

## PARAMETERS

- •

  **iter**: A *bson\_iter\_t*.

- •

  **options**: A (null).

## DESCRIPTION

The *bson\_iter\_regex()* function shall retrieve the contents of a BSON\_TYPE\_REGEX element currently observed by **iter**.

It is invalid to call this function when not observing an element of type BSON\_TYPE\_REGEX.

## RETURNS

A string containing the regex which should not be modified or freed. **options** is set to the options provided for the regex.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
