Regex - ChatGPT fails to correctly match a dot

ChatGPT, at the time of writing, seems to struggle with escaping a dot when writing a regular expression. For example… the question:

Can you confirm the regular expression to match a dot?

The response:

Yes, to match a literal dot in a regular expression, you need to escape it with a backslash ():

Find pattern: .

Note the omission of the backslash. It handles \d without a problem so it’s not the backslash itself, but rather the backslash before a dot:

1 Like