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 Expression | Match | Not a Match |
---|---|---|
.t | at, xt | ax, xx |
m.x | mix | mx, miix |
mi?x | mix, mx | miix |
m.?x | mix, max, mx | miix, 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.