As with the
m//
operator, the
s//
operator also allows the use of modifiers:
Modifier |
Meaning |
e |
evaluate the right side as an expression
|
Perl g-Modifier |
replace globally; in other words, all occurrences |
i |
do case-insensitive pattern matching |
m |
treat the string as multiple lines |
o |
only compile the pattern once |
s |
treat the string as a single line |
x |
use pretty-printing extensions |
The rest of the modifiers work the same as in the
m//
operator.
This module contains a "Pattern-matching modifiers" lesson and provides an explanation of the
m//
operator.