1 | The result of the expression |
2 | $string =~ m/$regex/ |
3 | is true if and only if the value of $string matches $regex. |
4 | For example, |
5 | if ( <STDIN> =~ m/^[Tt][Oo]:/ ) { ... } |
6 | matches if current input line starts with to: (any case) |
7 | Note: m/^to:/i is equivalent to above expression since modifier /i instructs pattern matcher to ignore case |
8 | Any delimiter may be used in place of the slash |
9 | m%^[Tt][Oo]:% # equivalent to previous expression |
10 | The m operator may be omitted, but then slash delimiters are required |