Appearance
REGEXP_INSTR
Return the index of the matching item.
Syntax
result = REGEXP_INSTR(input, pattern [, start [, reference]] [, flags])- input value
Specify the value against which the regular expression is matched.
- pattern value
Specify the regular expression to be matched against the
input.The
patternvalue must be a constant string and cannot be a column reference.- start value
The position in the
inputfrom where thepatternmatch starts. The default start position is 1.Yellowbrick does not support special meanings for negative
startvalues.The
startvalues can be column references.- reference value
Specify which
patternmatch is of interest. The default value is 1.The
referencevalues can be column references.- flags value
Can be either
ifor case-insensitive orcfor case-sensitive matching. Matching is case-sensitive by default.The
flagsvalue must be a constant string and cannot be a column reference.
Return
If the pattern is matched, the function returns the position of the matching text item.
If the pattern is not matched, the function returns 0.
Example
premdb=> select season_name,REGEXP_INSTR(season_name,'-') from season where numteams=22;
season_name | regexp_instr
-------------+--------------
1992-1993 | 5
1993-1994 | 5
1994-1995 | 5
(3 rows)