How to use special characters in regex?

Can you tell me the pattern for both “escape” and “@,!”
Thanks

1 Like

In a regex, ‘special characters’ are those that symbolize a particular class, such as \s for whitespace characters, \w for word characters, or \? for an actual question mark, \* for an actual asterix, since ? and * (among others) are also special characters.

The @ character can be used directly in the pattern without escapement. It is not special at all since it has no meaning apart from being a printable character.

The lesson should have link in the narrative to a table of regex special characters and their meanings.

3 Likes