Options for the substitution operator. : substitution « Regular Expression « Perl






Options for the substitution operator.

    

Option      Description 
g           Change all occurrences of the pattern 
i           Ignore case in pattern 
e           Evaluate replacement string as expression 
m           Treat string to be matched as multiple lines 
o           Evaluate only once 
s           Treat string to be matched as single line 
x           Ignore white space in pattern 

   
    
    
    
  








Related examples in the same category

1.Replace pattern
2.Replace pattern with ()
3.Substitute I with N and print
4.Substitute N with J
5.Substitute every T with M
6.Substitute first T with an M
7.Substitute first occurrence of "blue" with "red"
8.Substitute tom with Mary
9.Substitution Example
10.Substitution Modifiers
11.Using substitutions to clean up input data.
12.Capitalize all sentences
13.Using Patterns with Substitutions
14.Changing substitution delimiters
15.Increase salary with pattern match
16.Evaluate replacement
17.Alternation: /John|Karen|Steve/ will match a line containing John or Karen or Steve.
18.Options for the S Operator
19.Ignore case, global substitution