December 1999
Beginner
528 pages
11h 10m
English
To match certain specific characters or ranges of characters use []. You can separate the different characters that you want to match inside the brackets with commas; this is not mandatory (some systems do moan if you don’t use commas on complex expressions) but it does make the pattern more readable.
To specify a range of characters use the dash (-). This specifies a set or range where the range starts on the left-hand side of the dash and finishes on the right-hand side of the dash.
You should always use the [] when you want to home in on a string match. Suppose we wanted to match any single number, we could use:
[0123456789]
However, there is an easier method by using the dash (-):
[0-9]
or any lower ...
Read now
Unlock full access