Monday, 14 January 2013

Perl Notes - Regular Expressions


Regular Expressions

$str =~ /pattern/
("binky" =~ /ink/) ==> TRUE
("binky" =~ /onk/) ==> FALSE
Match anywhere in string
Do not need to "use up" the whole string
Must use up all of the pattern
$str interpolation works in regular expressions, so can say ($a =~ /$b/)

No comments:

Post a Comment