in reply to Re^2: Simple regexp questionin thread Simple regexp question
Test before contradicting someone.
print('*' =~ /^[*]$/ ? 'match' : 'no match', "\n"); # match print(']' =~ /^[*]$/ ? 'match' : 'no match', "\n"); # no match print('' =~ /^[*]$/ ? 'match' : 'no match', "\n"); # no match [download]
Only \, ^ (depending on position), - (depending on position), ], the sequence [:...:] and the regexp delimiter are special in character classes.