integer
- Returns starting index of specified
substring
- within
string, or zero if it's not present.
+ Returns first starting index of the specified
+
string, or zero if it's not present.
position('om' in 'Thomas')
text
- Extracts substring matching POSIX regular expression; see
+ Extracts the first substring matching POSIX regular expression; see
.
text
- Extracts substring matching
SQL regular expression;
+ Extracts
the first substring matching
SQL regular expression;
see . The first form has
been specified since SQL:2003; the second form was only in SQL:1999
and should be considered obsolete.
text[]
- Returns captured substring(s) resulting from the first match of a POSIX
+ Returns captured substrings resulting from the first match of a POSIX
regular expression to the
string; see
.
setof text[]
- Returns captured substring(s) resulting from matching a POSIX regular
- expression to the
string; see
- .
+ Returns captured substrings resulting from the first match of a
+ POSIX regular expression to the
string,
+ or multiple matches if the g flag is used;
+ see .
regexp_matches('foobarbequebaz', 'ba.', 'g')
text
- Replaces substring(s) matching a POSIX regular expression; see
- .
+ Replaces substrings resulting from the first match of a
+ POSIX regular expression, or multiple substring matches
+ if the
g flag is used; see
+ linkend="functions-posix-regexp"/>.
regexp_replace('Thomas', '.[mN]a.', 'M')
integer
- Returns
starting index of specified
substring
+ Returns
first starting index of the specified
substring
within
string, or zero if it's not present.
(Same as
position(substring in
string), but note the reversed
integer
- Returns starting index of specified
substring
- within
bytes, or zero if it's not present.
+ Returns first starting index of the specified
+
bytes, or zero if it's not present.
position('\x5678'::bytea in '\x1234567890'::bytea)
integer
- Returns
starting index of specified
substring
+ Returns
first starting index of the specified
substring
within
bits, or zero if it's not present.
pattern), provides extraction of a
substring
that matches a POSIX regular expression pattern. It returns null if
- there is no match, otherwise the portion of the text that matched the
+ there is no match, otherwise the first portion of the text that matched the
pattern. But if the pattern contains any parentheses, the portion
of the text that matched the first parenthesized subexpression (the
one whose left parenthesis comes first) is