In this section, we extend character checking to be more specific regarding the characters that we are checking for. You should ensure that you understand this in both directions—so you can create your own regex statements, and so you can interpret premade statements and which things they will match.
There are times when you might want to be more specific than just digit/non-digit or alphanumeric/non-alphanumeric.
One example might be checking a Cisco router message log based on severity (where the levels range from emergencies 0 through to debugging 7). While an 8 would match the \d search string, this would not be a valid severity level. Equally, if the logs were made from Simple Network Management Protocol (SNMP), the levels instead range from emergencies being 1 through to debugging at 8.
Alternatively, we might examine a file...