Name

. (Period) — Matches any character

Synopsis

The period matches any character in the underlying character set of the string to be searched, except that by default it does not match the newline character.

The following example uses a regular expression consisting of eight periods to extract the first sequence of eight contiguous characters from a string:

SELECT REGEXP_SUBSTR('Do not' || CHR(10) 
                  || 'Brighten the corner!'
                    ,'........')
FROM dual;

Brighten

These results do not include the first characters in the string, because the seventh character is a newline (CHR(10)), and that newline breaks the pattern. The first eight contiguous characters, exclusive of newlines, form the word 'Brighten‘.

You can specify 'n' in the optional match_parameter to cause the period to match the newline:

SELECT REGEXP_SUBSTR('Do not' || CHR(10) 
                  || 'Brighten the corner!'
                    ,'........',1,1,'n')
FROM dual;

Do not
B

Periods do not match NULLs, and they lose their special meaning when used 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.