跳转到主要内容

omni_regex

PCRE-compatible regular expressions

omnigres : PCRE-compatible regular expressions

Overview

ID Extension Package Version Category License Language
2961 omni_regex omnigres 0.1.0 FEAT Apache-2.0 C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r No Yes No Yes yes no

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.1.0 19 18 17 16 15 omnigres -
RPM PIGSTY 20260212 19 18 17 16 15 omnigres_$v postgresql$v-contrib, postgresql$v-plpython3, python3-pip
DEB PIGSTY 20260212 19 18 17 16 15 postgresql-$v-omnigres postgresql-plpython3-$v, python3-pip
Linux / PG PG19 PG18 PG17 PG16 PG15
el8.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
el8.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
el9.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
el9.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
el10.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
el10.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
d12.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
d12.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
d13.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
d13.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
u22.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
u22.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
u24.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
u24.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
u26.x86_64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212
u26.aarch64 N/A PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212 PIGSTY 20260212

Source

omnigres-20260212.tar.gz wheel-0.45.1-py3-none-any.whl

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 via package name, for the active PG version
pig install omni_regex;		# install by extension name, for the current active PG version

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

Operator Description
~ 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)

表格阅读器