I am a “newbie” to the Perl world so please be patient with me. I am trying to understand why the following code snippet works as it does. As written, it gives “NOT a match”, which is the expected “textbook” behavior. But if B* includes zero matches, why isn’t the “C” a match? Even with the anchors I do not understand.
Many thanks, Kevin
$_ = 'C'; if ( /^B*$/ ) { print ' a match ...', "\n"; } else { print ' NOT a match ...', "\n"; }
In reply to Anchors and zero matches question by dotykg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |