Matching in Perl, Python and Java

Quick quiz: Which of these expressions return a truthy value? Kudos if you don’t have to try it out or look it up.

Perl Python Java
"zabc" =~ /abc/ re.match("abc", "zabc") Pattern.matches("abc", "zabc")
"abcd" =~ /abc/ re.match("abc", "abcd") Pattern.matches("abc", "abcd")

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert