Check for non blank entry
Anonymous Monk
created: 2006-01-05 13:01:23
Trying to check data entry to make sure something was entered. If something is entered then continue processing. So I want to use a regular expression that checks if there is NO Blank entries and if so then process: This is not working:
!^\s*$ 
Re: Check for non blank entry
created: 2006-01-05 13:04:19
/\S/
(capital S) will check for the presence of non-whitespace.

Caution: Contents may have been coded under pressure.
Re: Check for non blank entry
created: 2006-01-05 13:07:37
!~ /^\s*$/ or =~ /\S/
Re: Check for non blank entry
created: 2006-01-05 13:29:06
If nothing was entered, your $value might be undefined so better to do (defined $value and $value =~ /\S/).

perlmonks.org content © perlmonks.org and Anonymous Monk, jZed, Roy Johnson, smokemachine

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03