{"Entry":{"collection":"func","key":"regexp-substr","name":"regexp_substr","aliases":[],"metadata":{"changed_in":["19"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"14","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"15"},{"descriptions_changed":true,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":["regexp_substr(string, pattern [, start [, N [, flags [, subexpr]]]]) → text"],"removed":[]},"status":"changed","to":"19"}],"content_hash":"801d16bf936e8967eea58baea02f66224346712e5f16c89fe10270d892d228b8","first_version":"15","group":"string","group_label":"String Functions And Operators","groups":["string","matching"],"imported_at":"2026-09-14T21:49:48.665984+08:00","last_version":"20","name":"regexp_substr","name_key":"regexp_substr","position":3035,"present_in":["15","16","17","18","19","20"],"signature":"regexp_substr ( string text, pattern text [, start integer [, N integer [, flags text [, subexpr integer ] ] ] ] ) → text","signature_count":2,"slug":"regexp-substr","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Returns the substring within string that matches the N'th occurrence of the POSIX regular expression pattern, or NULL if there is no such match; see Section 9.7.3.1.10.","summary_zh":""}},"Definition":{"Collection":"func","Key":"regexp-substr","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"regexp-substr","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Returns the substring within string that matches the N'th occurrence of the POSIX regular expression pattern, or NULL if there is no such match; see Section 9.7.3.","description_html":"Returns the substring within \u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e that matches the \u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e'th occurrence of the POSIX regular expression \u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e, or \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e if there is no such match; see \u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" title=\"9.7.3. POSIX Regular Expressions\"\u003eSection 9.7.3\u003c/a\u003e.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-STRING-OTHER","file":"functions-string.html","slug":"18"},"group":"string","group_label":"String Functions And Operators","lang":"en","layout":"table-new","pages":["functions-string.html"],"prose_only":false,"signatures":[{"description":"Returns the substring within string that matches the N'th occurrence of the POSIX regular expression pattern, or NULL if there is no such match; see Section 9.7.3.","description_html":"Returns the substring within \u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e that matches the \u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e'th occurrence of the POSIX regular expression \u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e, or \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e if there is no such match; see \u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" title=\"9.7.3. POSIX Regular Expressions\"\u003eSection 9.7.3\u003c/a\u003e.","description_zh":"","description_zh_html":"","examples":[{"expr":"regexp_substr('ABCDEF', 'c(.)(..)', 1, 1, 'i')","result":"CDEF"},{"expr":"regexp_substr('ABCDEF', 'c(.)(..)', 1, 1, 'i', 2)","result":"EF"}],"html":"\u003ccode class=\"function\"\u003eregexp_substr\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003estart\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eflags\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003esubexpr\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ]\u003c/span\u003e ]\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"regexp_substr ( string text, pattern text [, start integer [, N integer [, flags text [, subexpr integer ] ] ] ] ) → text","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-STRING-OTHER","file":"functions-string.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"regexp-substr","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"regexp_substr","Summary":"返回string中 POSIX 正则表达式pattern的第N次匹配对应的子字符串；如果没有这样的匹配，则返回NULL。参见第 9.7.3 节。","BodyHTML":"返回\u003cem\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e中 POSIX 正则表达式\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e的第\u003cem\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e次匹配对应的子字符串；如果没有这样的匹配，则返回\u003ccode\u003eNULL\u003c/code\u003e。参见\u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" rel=\"nofollow\"\u003e第 9.7.3 节\u003c/a\u003e。\u003cpre\u003eregexp_substr ( string text, pattern text [, start integer [, N integer [, flags text [, subexpr integer ] ] ] ] ) → text\u003c/pre\u003e返回\u003cem\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e中 POSIX 正则表达式\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e的第\u003cem\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e次匹配对应的子字符串；如果没有这样的匹配，则返回\u003ccode\u003eNULL\u003c/code\u003e。参见\u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" rel=\"nofollow\"\u003e第 9.7.3 节\u003c/a\u003e。","SourceRevision":"1b5ca64c","ContentHash":"f45d7d4a2233c10144355c0c0f08356c25870d98437d1b5c948f82f955a9ad9b","Payload":{"description_zh":"返回string中 POSIX 正则表达式pattern的第N次匹配对应的子字符串；如果没有这样的匹配，则返回NULL。参见第 9.7.3 节。","description_zh_html":"返回\u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e中 POSIX 正则表达式\u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e的第\u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e次匹配对应的子字符串；如果没有这样的匹配，则返回\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。参见\u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" title=\"9.7.3. POSIX正则表达式\"\u003e第 9.7.3 节\u003c/a\u003e。","signatures":[{"description_zh":"返回string中 POSIX 正则表达式pattern的第N次匹配对应的子字符串；如果没有这样的匹配，则返回NULL。参见第 9.7.3 节。","description_zh_html":"返回\u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e中 POSIX 正则表达式\u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e的第\u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e次匹配对应的子字符串；如果没有这样的匹配，则返回\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。参见\u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" title=\"9.7.3. POSIX正则表达式\"\u003e第 9.7.3 节\u003c/a\u003e。","returns":"text","text":"regexp_substr ( string text, pattern text [, start integer [, N integer [, flags text [, subexpr integer ] ] ] ] ) → text","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"314bc95bc4f6f9b9d6a97f54e28d32925df3283907307a4051f261419fad0087","Text":"regexp_substr ( string text, pattern text [, start integer [, N integer [, flags text [, subexpr integer ] ] ] ] ) → text","Returns":"text","Payload":{"description":"Returns the substring within string that matches the N'th occurrence of the POSIX regular expression pattern, or NULL if there is no such match; see Section 9.7.3.","description_html":"Returns the substring within \u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e that matches the \u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e'th occurrence of the POSIX regular expression \u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e, or \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e if there is no such match; see \u003ca href=\"/docs/18/functions-matching.html#FUNCTIONS-POSIX-REGEXP\" title=\"9.7.3. POSIX Regular Expressions\"\u003eSection 9.7.3\u003c/a\u003e.","description_zh":"","description_zh_html":"","examples":[{"expr":"regexp_substr('ABCDEF', 'c(.)(..)', 1, 1, 'i')","result":"CDEF"},{"expr":"regexp_substr('ABCDEF', 'c(.)(..)', 1, 1, 'i', 2)","result":"EF"}],"html":"\u003ccode class=\"function\"\u003eregexp_substr\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003estart\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eflags\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003esubexpr\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\u003c/span\u003e ]\u003c/span\u003e ]\u003c/span\u003e ]\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"regexp_substr ( string text, pattern text [, start integer [, N integer [, flags text [, subexpr integer ] ] ] ] ) → text","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
