How to Use substring() with Regular Expressions

To extract a substring using a regular expression, Oracle provides the function regexp_substr, which receives a source string and a pattern with the regular expression. The function regexp_substr returns a substring matching the regular expression.

select regexp_substr('hello how are you', 'h[a-z]* ') as a_word_starting_with_h
from dual;
a_word_starting_with_h
hello

IN THIS PAGE