Here is the pattern:
string str =
"+++++tom cruise 9:44AM something text here \r\n +++++mark taylor 9:21PM";
only string that starts with +++++ and ends with AM or PM should get selected. What is Regex.split or linq query pattern?
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.
Try this regex:
Output:
or:
I recommend this regex. It will match until at find a hour on format xY:xY:AM/PM where Y is opcional. Test drive:
Output: