Name

$ (Dollar Sign) — Matches the end-of-line

Synopsis

Use the dollar sign ($) to anchor a regular expression to the end of the source text, or to the end of a line within the source text.

For example, the $ in the following query’s regular expression is the reason why 'three' is returned rather than 'one':

SELECT REGEXP_SUBSTR(
   'one two three','(one|two|three)$')
FROM dual;

three

As with the caret (^), you can use 'm' to treat the source text as a series of “lines” delimited by newline (CHR(10) on Unix systems) characters.

The $ is not a metacharacter within square brackets([]).

Get Oracle Regular Expressions Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.