On Aug 23, Michel Blanc said:
>> sub unique_char_set {
>> my ($str, $chars) = @_;
>> return 0 if $str =~ /[^\Q$chars\E]/;
>> return !($str =~ /(.).*?\1/s);
>> }
>
>Thanks for your response guys. This is very useful.
>
>In fact, since I needed a one liner (I forgot to say that) for a
>regex-based dispatch table, I tried to convert that to :
Ok. Then use this:
if ($str =~ /[^cCdeEfghiIkKlLmMrRstTvVxX]|(.).*?\1/) {
# it was a bad string
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]