Q:

What does (?ms) in Regex mean?

I have following Regex in Powershell :
[regex]$regex = 
@'
(?ms).*?<DIV class=row>.*?
'@

What does (?ms) mean here.

A:

(?m) is the modifier for multi-line mode. It makes ^ and $ match the beginning and end of a line, respectively, instead of matching the beginning and end of the input.
For example, given the input:

ABC DEF
  GHI

The regex ^[A-Z]{3} will match:

"ABC"

Meanwhile, the regex (?m)^[A-Z]{3} will match:

"ABC"
"GHI"

(?s) is the modifier for single-line mode. It adds linebreaks and newlines to the list of characters that . will match. 
Given the same input as before, the regex [A-Z]{3}. will match (note the inclusion of the space character):

"ABC " 

While the regex (?s)[A-Z]{3}. will match:

"ABC "
"DEF\n"

Despite their names, the two modes aren't necessarily mutually exclusive. In some implementations they cancel out, but, for the most part, they can be used in concert. You can use both at once by writing (?m)(?s) or, in shorter form, (?ms).
EDIT:
There are certain situations where you might want to use (?ms). The following examples are a bit contrived, but I think they serve our purpose. Given the input (note the space after "ABC"):

ABC
  DEF
  GHI

The regex (?ms)^[A-Z]{3}. matches:

"ABC "
"DEF\n"

While both (?m)^[A-Z]{3}. and (?s)^[A-Z]{3}. match:

"ABC "

A:

Sometimes people say (?s) is single line mode. Its not, there is no such thing.
It means  the Dot meta-char . matches any newline, meaning the Dot matches any character.
The default is usually the Dot does Not match newline, so you have to specifically
set the Dot-All modifier through the regex options constant, or the inline modifier (?s).  
(?m) is the multi-line modifier. It lets the anchors ^$ match beginning/end of lines, as
well as beginning/end of string.  
How/when/should  (?ms) be used together?
The answer is that sometimes you want to use the Dot to span newlines, while at the same time
need ^ to match at beginning of line. And you are not to sure about anything inbetween.
Example:  
(?ms)^BlockStart.*?BlockEnd 
where the input is:  
StringStart aasdfasdffasdf
asgasgasgw fasfggasfgaag
BlockStart asgdfasggafsdgadsfg 
aaaasfgaafdsgasfg 
afbaadsf afdsgadsfg BlockEnd afsbgafsdgasfg
aaaaaafrgasfgaadsfgg  

