On 10-07-2010 08:48, Valery wrote:
Quote:
string s = "def" + System.Environment.NewLine + "ghi";
bool b = Regex.IsMatch(s, "^def$", RegexOptions.Multiline);
whereas
string s = "abc" + System.Environment.NewLine + "def";
bool b = Regex.IsMatch(s, "^def$", RegexOptions.Multiline); |
Use:
string s = "def\nghi";
and:
string s = "abc\ndef";
then it seems to work.
I think it is a bit weird to use *nix semantics in .NET,
but that seems to be how it is.
Docs says:
<quote>
$
The match must occur at the end of the string or before \n at the end of
the line or string.
</quote>
So it is documented.
Arne