Regex

Metacharacter:

  • $: end of a string
  • ^: beginning of a string
  • .: any character

Class/group of character:

  • []: a class of characters, i.e, anything that is in the brackets
  • [^]: complementary class, anything that is not in this class
  • -: interval within a class
  • |: logical OR
  • (): substring

Quantification:

  • ?: optional but if it appears, only 1 time. I.e, 0 to 1 occurence
  • *: optional and if it appears, it can be any number of times. I.e, 0 to any number of occurence
  • +: must appear any number of times. I.e, 1 to any number of occurence
  • {x}: must appear exactly x times.
  • {x,}: must appear at least x times.
  • {x,y}: must appear between x to y times.