PROGRAMMING

 
REMEMBERS




Last update:   22-10-2021

Character class

Match any one of serveral characters. Find g, r, followed either an e or a, followed by y.
 
gr[ea]y
! Outside a class literal characters have an implied AND-THEN between them. Inside inside a class the implication is OR ! Within a character class metacharacter "-" (dash) indicates a range of characters. Multiple ranges are fine: [0-9A-F]
 
 [0-9A-F]
You can freely combine ranges with literal characters: [0-9a-z_!.?] Note that a dash is a metacharacter only within a character class. Otherwise it matches the normal dash character. Tasks    (2/2)

Tasks

Regex to find gray or gray but not greay
 
//g

The text is gray or grey but not greay
Regex to find gray, grey or gre-ay
 
//g

The text is gray, grey or gre-ay

Questions    
Negated classes

        A B C D E F
🔔
1/4