I need to extract only the last row from a multi-line string using regular expressions. I am trying to use a SingleLine pattern like following @”\n(.*?)$” but, unfortunately it extracts the text starting with second line to end. Any hint?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What about something like
That means match everything that is not a newline character till the end of the string.
Well, when I think about it, when you don’t use the DOTALL modifier then this should be fine
Without this modifier the
.does not match newline characters. So no need for a\nat the beginning.