Regex Flashcards
Regex - any digit / any non digit
Any digit - \d
Any no digit - \D
Regex - any character
Any character - .
Regex - only certain character / only not certain character
Only - [those character / a-z for short form from A to Z]
Not - [^ those character]
Regex - any alphanumeric character / not
Any - \w
Not - \W
Regex - repetition of n
Ans - n{x, y} / n {x}
N repeats from x to y times
N repeats x times
Regex - zero or more repetition / one or more repetition
Zero - *
One - +
Regex - special characters (need to add )
.*+^?$()[]{}|\
Regex - any white space / any not white space
Any - \s
Not - \S
Regex - starting at / ending with
Start - ^ (put in front of the regex)
eg: ^abc -> string start with abc will be recognised
End - $ (put in the end of the regex)
eg: abc$ -> string end with abc will be recognised
Regex - matching two possibilities
(abc|def)