C# RegEx Not returning what it should
I got this Regex problem where I need to select the last part of a string
however no matter what I do it will only select on till it hit's a "\n"
(newline) Here's what I have tried so far
sms = Regex.Match(datalog, "\"\\r\\n.*").ToString();
Or
sms = Regex.Match(datalog, @"\""\r\n.*").ToString();
Here is what datalog contains
"\r\n+CMT: \"+4528835769\",,\"13/09/11,15:09:32+08\"\r\nLinje
1\nLinje2\nLinje 3\r\n
And what i need the Rexex to return
"\r\nLinje 1\nLinje2\nLinje 3\r\n
but this is what it returns (and what the string sms ends up containing)
"\"\r\nLinje 1"
What am I doing wrong?? since it stops selecting after Linje 1\n I assume
the problem is with the newline.
I have also tried using .+ instead of .* but the result is the same
No comments:
Post a Comment