I need some help with this one.
I'm using the below code, supplied by Chris071371, as part some form validation.
It's dsigned to catch long continious charactor strings from within a textarea.
foreach (@words) {
print "$_<br>";
unless ($_ =~ /^\S{1,25}$/) {
push(@input_err, "$col (You have words that are too long!)");last;
}
}Now I'm using \S, which should match a single non-whitespace character.
The problem I'm having is that of leading white spaces.
Trailing white spaces don't seem to be the problem, but even a single white space at the beginning of a single character string, will return an error.
All I need to do is to check all non-whitespace characters.
thanks
Bob
[This message has been edited by lanerj (edited January 26, 2000).]
I'm using the below code, supplied by Chris071371, as part some form validation.
It's dsigned to catch long continious charactor strings from within a textarea.
Code:
@words = split(/\s/,$in{'Description'}); foreach (@words) {
print "$_<br>";
unless ($_ =~ /^\S{1,25}$/) {
push(@input_err, "$col (You have words that are too long!)");last;
}
}
The problem I'm having is that of leading white spaces.
Trailing white spaces don't seem to be the problem, but even a single white space at the beginning of a single character string, will return an error.
All I need to do is to check all non-whitespace characters.
thanks
Bob
[This message has been edited by lanerj (edited January 26, 2000).]