POSITION_REGEX
Example
Section titled “Example”SELECT POSITION_REGEX('C' IN 'Oracle' ) FROM DUAL;Output
Section titled “Output”4Explanation
Section titled “Explanation”In the above example, POSITION_REGEX function finds the position of the first occurrence of ‘C’ in the string ‘Oracle’. The function returns the position as an integer value, which in this case is 4.
Example
Section titled “Example”SELECT POSITION_REGEX('W' IN 'Hello World' SIMILAR TO '%');Output
Section titled “Output”7Explanation
Section titled “Explanation”The POSITION_REGEX() function in the example checks for the position of the character ‘W’ in the string ‘Hello World’. It’s similar to to ’%’ which signifies any string sequence. The returned value is ‘7’, indicating that the ‘W’ is at the seventh position in the string ‘Hello World’.