I\'m reading the regular expressions reference and I\'m thinking about ? and ?? characters. Could you explain me with some examples their usefulness? I don\'t understand the
?
simply makes the previous item (character, character class, group) optional:
colou?r
matches "color" and "colour"
(swimming )?pool
matches "a pool" and "the swimming pool"
??
is the same, but it's also lazy, so the item will be excluded if at all possible. As those docs note, ?? is rare in practice. I have never used it.