Meaning of (?s) in regex Meaning of (?s) in regex powershell powershell

Meaning of (?s) in regex


According to Regular Expressions reference site.

Turn on "dot matches newline" for the remainder of the regular expression. (Older regex flavors may turn it on for the entire regex.)


"?" means 1 or 0 matches. "?s" enables dot matching newlines. A period is normally a wildcard that will match any character, save the newline.