21
loading...
This website collects cookies to deliver better user experience
[fcr]
thing is now a placeholder for either an “f”, a “c” or an “r”. Combined with the “at” after it, this expression only matches exactly the three words “fat”, “cat” and “rat”. But, as you can see, also as part of other words. You will learn how to avoid that in a moment.[abcdefghijklmnopqrstuvwxyz]
. You can simply write [a-z]
. For numbers it’s [0-9]
and you can even combine them easily. [a-z0-9]
is a placeholder for all letters and numbers and[b-f1-6]
is one for all letters from b to f and numbers from 1 to 6.[a-z]
and [A-Z]
wouldn’t be the same. And in that case, don’t try things like [A-z]
. It doesn’t do what you might hope for. But you can use [a-zA-Z]
… or just check that box.[0-9]+
or [a-z]*
[0-9]{2,4}
or “at least three times”:[a-z]{3,}
.\b
“helper” doesn’t really match any characters. It means “word ends here” or “word starts here”, depending on where you put it. If you put it on both sides, that means you are looking for a “whole word”..+*?()[{^$|\
That means you can’t just search for them literally. To do that you have to put a backslash in front of them. With that, we can fix the issue from the first example.21