Check for white space : Pattern matching « Regular Expression « Perl
- Perl
- Regular Expression
- Pattern matching
Check for white space
#!/usr/bin/perl -w
foreach $patt (@ARGV) {
# Check for white space.
if ($patt =~ /\s/) {
print "\tFound white space in \"$patt\".\n";
}
}
Related examples in the same category