Add three new regexp functions: regexp_matches, regexp_split_to_array,
Neil Conway <neilc@samurai.com>
Add three new regexp functions: regexp_matches, regexp_split_to_array, and regexp_split_to_table. These functions provide access to the capture groups resulting from a POSIX regular expression match, and provide the ability to split a string on a POSIX regular expression, respectively. Patch from Jeremy Drake; code review by Neil Conway, additional comments and suggestions from Tom and Peter E. This patch bumps the catversion, adds some regression tests, and updates the docs.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +176 −8 |
| src/backend/utils/adt/regexp.c | modified | +526 −55 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_proc.h | modified | +13 −1 |
| src/include/utils/builtins.h | modified | +7 −1 |
| src/test/regress/expected/strings.out | modified | +225 −2 |
| src/test/regress/sql/strings.sql | modified | +52 −1 |