Martin, Greg (CSC) wrote:
> If there's a better place to post this, please let me know.
>
> I'm trying to write a module that looks at mailbox names and excludes
> non-people. I use regex to match specific strings which I no are not
> people, but I'd like a generic regex to match strings which have no spaces
> (a common indicator of non-human mailboxes). This should be easy and I've
> tried several things but just can't get through the mental block
>
> My feeble tries:
> [^\s] (matches every non-space character)
> [\s{0}] (0 occurrences of set \s - excludes everything apparently)
> \s{0} (0 occurrences of \s - same thing)
If I understand your question (you really should post a code snippet):
if ($str =~ /\s+/) {
# string has whitespace
}
# or for just spaces/blanks rather than ' ', \t, \n try: if ($str =~ / +/) {
# \s means whitespace not space/blank
--
,-/- __ _ _ $Bill Luebkert ICQ=162126130
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs