Modul 30 von 33 · Medien
Modifiers
Modifiers
Modifiers are placed outside the two backslashes on the right side and they modify the method of the pattern, but not the pattern itself.
The first modifier is the i modifier. When present, ignores the case sensitivity between the pattern and the tested string. So returns a match regardless of uppercase or lowercase issues.
The g modifier, or global modifier, does not return only the first match that the pattern identifies but continues throughout the whole string for further matches. This is extremely useful when used alongside the match function for type of string.
Last there is the m modifier, that checks also for multi-line strings and doesn't stop in the end of the first line only.