Online Test Banks
Score higher
See Online Test Banks
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

Shortcuts for Character Ranges in Perl

Part of the Perl For Dummies Cheat Sheet

You're programming along in Perl and want to use a code shortcut to represent anything from a number to a non-number to any letter or number. You're in luck, because the following table gives you the code, shows you what it’s a shortcut for, and describes it.

Code Replaces Description
\d [0..9] Any digit
\w [a-zA-Z_0-9] Any alphanumeric character
\s [ tnrf] A whitespace character
\D ^[0..9] Any non-digit
\W ^[a-zA-Z_0-9] Any non-alphanumeric character
\S ^[ tnrf] A non-whitespace character
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

Perl For Dummies Cheat Sheet


Inside Sweepstakes

Win $500. Easy.