in reply to Perl and Excel
to something that matches what will exist in the cell. So instead of checking to see if it has at least non-space character, you can check to make sure it has one of whatever character might be in there. If you are dealing strictly with numbers:if (/\S+/){ . . .}
would work. or if dealing with numbers and letters and an underscore:if (/[0-9]/){ ... }
On another note the + is ambiguous as it will only be true if there is at least one of whatever character you are matching anyway.if (/[\w]/) {...}
update: much to my chagrin. Yes \d is the same as [0-9] and the brackets are not necessary with \w or the \d for that matter. Thank you anonymous monk.
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl and Excel
by Anonymous Monk on Jan 13, 2003 at 21:45 UTC | |
|
Re: Re: Perl and Excel
by Anonymous Monk on Jan 13, 2003 at 23:00 UTC | |
by Anonymous Monk on Jan 14, 2003 at 00:18 UTC |