Skip to content

omni_regex

PCRE-compatible regular expressions

omnigres · PCRE-compatible regular expressions

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2961omni_regexomnigres0.1.0FEATApache-2.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY0.1.019 18 17 16 15omnigres-
RPMPIGSTY2026021219 18 17 16 15omnigres_$vpostgresql$v-contrib, postgresql$v-plpython3, python3-pip
DEBPIGSTY2026021219 18 17 16 15postgresql-$v-omnigrespostgresql-plpython3-$v, python3-pip
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el8.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el9.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el9.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el10.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
el10.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d12.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d12.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d13.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
d13.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u22.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u22.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u24.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u24.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u26.x86_64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212
u26.aarch64N/APIGSTY 20260212PIGSTY 20260212PIGSTY 20260212PIGSTY 20260212

Source

pig build pkg omnigres;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install omnigres;		# install by package name
pig install omni_regex;		# install by extension name

pig install omni_regex -v 18;   # install for PG 18
pig install omni_regex -v 17;   # install for PG 17
pig install omni_regex -v 16;   # install for PG 16
pig install omni_regex -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION omni_regex;

Usage

omni_regex: PCRE-compatible regular expressions

The omni_regex extension provides PCRE2-based regular expression support with named capture groups.

Operators

OperatorDescription
~Matches string against regex
!~Non-matching operator
=~Alternative matching (same as ~)
SELECT 'foo' ~ regex 'fo+';   -- true
SELECT 'bar' !~ regex 'foo';  -- true

Functions

regex_match(text, regex) – Returns captured groups from the first match:

SELECT regex_match('ABC123', '([A-Z]*)(\d+)');  -- {ABC,123}

regex_matches(text, regex) – Returns all matches as a set of text arrays:

SELECT regex_matches('foo1bar', '(fo+|bar)(\d?)');
-- {foo,1}
-- {bar,""}

regex_named_groups(regex) – Extracts named capture groups:

SELECT index FROM regex_named_groups('(fo+|bar)(?<num>\d?)')
WHERE name = 'num';  -- 2

Named capture group syntax: (?<name>REGEX)

Table reader