↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / String Functions And Operators

regexp_matches

Read the PG 18 manual

Returns substrings within the first match of the POSIX regular expression pattern to the string, or substrings within all such matches if the g flag is used; see Section 9.7.3.

Reading PG 18current·documented in 20 of 27 versions, 8.3 to 20

Signatures & examples

regexp_matches ( string text, pattern text [, flags text ] ) → setof text[]
Returns substrings within the first match of the POSIX regular expression pattern to the string, or substrings within all such matches if the g flag is used; see Section 9.7.3.
regexp_matches('foobarbequebaz', 'ba.', 'g') → {bar}
{baz}
Version history 5
  1. 18 → 19 changed
  2. 14 → 15 changed
  3. 12 → 13 changed
  4. 9.6 → 10 changed
  5. 8.2 → 8.3 added

Definition snapshot: b7bd9cda · English manual source