Electron One wrote:

> In a character class, how do you include open and closed blocks? Ive tried
> this,
> 
> [a-z0-9_.[\]!><]+
> 
> and it doesnt work. I have also tried this,
> 
> [a-z0-9_.\[\]!><]+
> 
> and it too doesn't work. I want my character class to include any digits,
> alphabet characters, an underscore, a period, an exclamation mark, a
> greater than and less than symbol, AND an open block and closed block
> symbol. Any help would be appreciated.

Seems fine to me - how about creating a failing snippet.  This works:

use strict;

# added '-' on second string to make it fail

foreach ('abcdwxyz09_.[]!><', 'abcdwxyz09_.[]!><-') {

        if (/^[a-z0-9_.\[\]!><]+$/) {
                print "'$_' OK\n";
        } else {
                print "'$_' not OK\n";
        }
}

__END__


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to