Metacharachters in regex | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Metacharachters in regex

In regex whats the difference between the metacharachters - ? and * Both of them seem to mean 'zero or more repetitions' of the previous thing ? So if I was to use the pattern : r"colo(u)*r" OR r"colo(u)?r" They would both give me the same result. Am I missing something ?

27th Feb 2017, 4:52 AM
Jayneesh W
Jayneesh W - avatar
1 Answer
+ 2
Sorry I just realized ? means zero or ONE and * is zero or MORE
27th Feb 2017, 4:56 AM
Jayneesh W
Jayneesh W - avatar