We can’t just remove it because then it would not find things that look like:
[video] because these strings contain the characters
\ in front of special characters like
], these characters would be treated in a special way…this is why we call them special characters: they do special things! But sometimes, like in these exercises, we do not want special characters like
 to behave special in any way…sometimes we just want a
[ or a
] to be treated like a normal character that we can search for/match on.
So how do we do that? How do we search for a character that is special? Answer: put a backslash in front of it!
One way that is helping me understand how regular expressions work with backslashes is to think of the backslash and the following character as being one character not two.
[ --> signals the start of a set
\[ --> this is a literal square bracket, this has no special meaning…it is just one character: