May 2015
Intermediate to advanced
112 pages
2h 14m
English
Ranges in Regex allow you to create your own custom constraints, much like the ones we just went through. In a range, you can specify exactly the characters that can be used or if it's faster, you can specify the inverse, that is, the characters that do not match.
For the sake of illustration, let's say we wanted to match only abc. In this case, we could create a range similar to [abc] and it will match a single character, which is either a, b, or c. Let's test it out with the bicycle text and the /[abc]/g pattern:

Now, this will work, however, if you have a lot of characters you need to match, your range ...
Read now
Unlock full access