List all the identifiers for characters required in patterns?

1.1K    Asked by MiuraBaba in Data Science , Asked on Jan 5, 2020
Answered by Nitin Solanki

Characters such as a digit or a single string have different codes that represent them. We can use these to build up a pattern string. Notice how these make heavy use of the backwards slash ‘’. Because of this when defining a pattern string for regular expression we use the format:

army pattern'

Placing the r in front of the string allows python to understand that the in the pattern string are not meant to be escape slashes.

Below there is a table of all the possible identifiers:



Your Answer

Interviews

Parent Categories