\ is a special symbol in regex. Whenever you place it before a sign, you tell the program, “dont read this sign literally, it stands for something”. When we write d, the program reads the lower case letter “d”. When we write \d, the program takes it as a sign for all digits. \s stands for whitespace character, which can range from single space, or a new line, or a tab space. When we wrap a regular expression inside brackets, we call it a capture group, something we can refer to later, for example (\d+). \1 will refer to the first capture group in our expression. \d+ stands for one or more digits. /(\d+) \1 \1 / , here we will match the “one or more digits” string and also look if that same string repeats twice more, like with the case with “42 42 42”.