A Perl Regular Expressionfor Identifier
$identifier = "[a-z][a-z0-9]*";
$sentence = "012,cse341 341,ABC]*";
if ($sentence =~ /$identifier/) {
print "Seems to be an identifier here." ;
}
$ident2 = "[a-zA-Z][a-zA-Z0-9]*";
$reservedWord = "begin|end";
Previous slide
Next slide
Back to first slide
View graphic version