Regular Expression - . Matches Any Character

The full stop or period (.) matches with any single character.
It is often combined with asterisk (.*) to mean "anything" - any number of any characters - including nothing.
If you need a real full stop/period, then use the escape character "slash"(\.).
It does not match the end of line marker (newline)

Examples

Lines that contain s something something ck

s..ck
This would match the following:
slick
stick
stuck
speck
Stones and sticks - it can appear anywhere in the line.
Consonants that go together e.g. th,sp,ck,hsbc. Dot can be non-letter characters.
It would not match the following:
This sucks. Only one letter after s.
No matches for duck. Many letters more letters than 2 after s.

Lines that only contain s something something ck

^s..ck$
This would match the following:
slick
stick
stuck
speck
sp+ck
It would not match the following:
This sucks. Only one letter after s.
No matches for duck. Many letters more letters than 2 after s.
Stones and sticks - it cannot appear anywhere in the line.
sticky

Computing Articles