regular expressions table character class shorthands symbol meaning matches any character except newlineor any character at all with the re dotall flagor inside character class matches literal \ matches unicode digitor [ - with the re ascii flag meaning of the flags \ matches unicode nondigitor [^ - with the re ascii flag \ matches unicode whitespaceor \ \ \ \ \vwith the re ascii flag \ matches unicode nonwhitespaceor [\ \ \ \ \vwith the re ascii flag \ matches unicode "wordcharacteror [ -za- - _with the re ascii flag \ matches unicode non-"wordcharacteror [^ -za- - _with the re ascii flag having different minimum and maximum is often convenient for exampleto match travelled and traveled (both legitimate spellings)we could use either travel{ , }ed or travell{ , }ed the { , quantification is so often used that it has its own shorthand form?so another way of writing the regex (and the one most likely to be used in practiceis travell?ed two other quantification shorthands are providedwhich stands for { , ("at least one"and which stands for { , ("any number of")in both cases is the maximum possible number allowed for quantifierusually at least all the quantifiers are shown in table the quantifier is very useful for exampleto match integers we could use \dsince this matches one or more digits this regex could match in two places in the string for example and sometimes typos are the result of pressing key too long we could use the regex bevel+ed to match the legitimate beveled and bevelledand the incorrect bevellled if we wanted to standardize on the one spellingand match only occurrences that had two or more lswe could use bevell+ed to find them the quantifier is less usefulsimply because it can so often lead to unexpected results for examplesupposing that we want to find lines that contain comments in python fileswe might try searching for #but this regex will match any line whatsoeverincluding blank lines because the meaning is "match any number of # "--and that includes none as rule of thumb for those new to regexesavoid using at alland if you do use it (or if you use ?)make sure there is at least one other expression in the regex that has nonzero quantifier--so at least one quantifier other than or since both of these can match their expression zero times