Match All Non-Numbers # 34

The last challenge showed how to search for digits using the shortcut \d with a lowercase d. You can also search for non-digits using a similar shortcut that uses an uppercase D instead.

The shortcut to looking for non-digit characters is \D. This is equal to the character class [^0-9], which looks for a single character that is not a number between zero and nine.


Post a Comment

Previous Post Next Post