Hi,
I'm using my imagination as to the nature of the problem. Here's one
approach.
1. construct a hash of special characters.
2. split the spring on 'nothing' and construct a hash of characters.
3. Then use the exists function to test for the presence of the
character in the string.
CPAN should have a module to your problem (I'm sure).
This is Perl so no doubt other suggestions will be posted.
Good luck,
Alfred Vahau
IT Services
Uni. PNG
-----------------------------------
Subject: checking for special chars in a string
Date: Thu, 14 Nov 2002 18:38:23 +0530
From: Ramprasad A Padmanabhan <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Hello all,
I am sure this must have been asked before But I cant find it
How do I find if
$str has any special chars ( I mean above 127 in the ascii range )
I do not want to do an ord of each character
like while($str=~/(.)/g) { return('found') if(ord($1) > 127) }
Thanks
Ram