-
- Downloads
Implement regexp_match(), a simplified alternative to regexp_matches().
regexp_match() is like regexp_matches(), but it disallows the 'g' flag and in consequence does not need to return a set. Instead, it returns a simple text array value, or NULL if there's no match. Previously people usually got that behavior with a sub-select, but this way is considerably more efficient. Documentation adjusted so that regexp_match() is presented first and then regexp_matches() is introduced as a more complicated version. This is a bit historically revisionist but seems pedagogically better. Still TODO: extend contrib/citext to support this function. Emre Hasegeli, reviewed by David Johnston Discussion: <CAE2gYzy42sna2ME_e3y1KLQ-4UBrB-eVF0SWn8QG39sQSeVhEw@mail.gmail.com>
Showing
- doc/src/sgml/func.sgml 109 additions, 46 deletionsdoc/src/sgml/func.sgml
- src/backend/catalog/information_schema.sql 1 addition, 1 deletionsrc/backend/catalog/information_schema.sql
- src/backend/utils/adt/regexp.c 96 additions, 41 deletionssrc/backend/utils/adt/regexp.c
- src/include/catalog/catversion.h 1 addition, 1 deletionsrc/include/catalog/catversion.h
- src/include/catalog/pg_proc.h 6 additions, 2 deletionssrc/include/catalog/pg_proc.h
- src/include/utils/builtins.h 2 additions, 0 deletionssrc/include/utils/builtins.h
- src/test/regress/expected/regex.out 28 additions, 0 deletionssrc/test/regress/expected/regex.out
- src/test/regress/expected/strings.out 2 additions, 2 deletionssrc/test/regress/expected/strings.out
- src/test/regress/sql/regex.sql 7 additions, 0 deletionssrc/test/regress/sql/regex.sql
Loading
Please register or sign in to comment