When you specify a regular expression, it will by default only match the first occurrence that it encounters. It is possible to specify a pattern to match that can occur several times in a line. To match all of these, you can use the 'g' attribute. The 'g' stands for global matching.
There is one other attribute that allows the matching to be carried out in a case-insensitive manner. That is the 'i' attribute.
Both of these attributes are placed after the closing slash at the end of the pattern.
The case-insensitive match works like this:
would match the following strings
The g attribute applied like this, would cause the pattern:
to match every zero in the string:
'0100, 00123, "00067", 666000'
Here is a list of the available attributes:
|00||g||Global match for every occurrence of the pattern throughout the line.||1.2|
|02||ig||Case-insensitive global match.||1.2|
|15||gm||Global match on multiple lines.||1.5|
|15||im||Case-insensitive matching on multiple lines.||1.5|
|16||igm||Case-insensitive global match on multiple lines.||1.5|