Perl regex: horizontal space

Self-tutoring about Perl regular expressions: the tutor makes an observation.

Perl has the interesting character class \h that signifies “horizontal whitespace.” It can be very useful to capture a word in a sentence.

Suppose, for instance, you want to capture Hello76 from the following sentence:

On the brick wall old graffiti told this message: Jimmy Carter Hello76 Good Luck.

/\h\w*76/ should work:)

Source:

perldoc.org

Robert’s Perl Tutorial

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply