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") |