Options for Perl Regular Expressions


OptionDescriptionBackend valuePortable value
mMultilinemultilinemultiline
sSingle linedotall(not portable)
iCase-insensitiveignorecaseignorecase
xExtended with whitespace and commentscommentcomments
pPreserve matched stringsp(not portable)
gGlobal matchglobal(not portable)
cKeep current positionc(not portable)
aUse ASCII charset rulesa(not portable)
dUse default charset rulesd(not portable)
lUse locale charset rulesl(not portable)
uUse Unicode charset rulesu(not portable)
When m and s together, . matches any char including newlines but ^ and $ match lines.