Match a Single Character ( . ) (?)

You can match any single character with a dot (.). A dot means there must be a character in the string.

You can make a single character optional by placing a question mark (?) after it.

Regular ExpressionMatchNot a Match
.tat, xtax, xx
m.xmixmx, miix
mi?xmix, mxmiix
m.?xmix, max, mxmiix, maax

Get Spring Into Linux® 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.