I need to use regular expression to this string:
"\r\n+CMGL: 0,\"REC READ\",\"+79119968091\",,\"13/10/28,15:22:36+16\"\r\n10160008\r\n$GPMC,081915,A,5614.6801,N,04359.0266,E,0.0,190.2,121109,,*19\r\n+CMGL: 1,\"REC READ\",\"+79119968091\",,\"13/10/28,15:34:26+16\"\r\n#ALARM! \r\n10160008\r\n$GPMC,081915,A,5614.6801,N,04359.0266,E,0.0,190.2,121109,,*19\r\n\r\nOK\r\n"
I need to get 2 substrings(every substring starts with \r\n+CMGL: and ends with \r\n) from string above:
I have this regular expression
Regex r = new Regex(@"\+CMGL: (\d+),""(.+)"",""(.+)"",(.*),""(.+)""(\r\n((.|\n)*)\r\n\b)");
This regular expression works good but not for last group (\r\n((.|\n)*)\r\n\b). Problem is that i don't know how much \r\n symbols string will have until I see start of new substring (\r\n+CMGL: ). Thank in advance
For Starting with \r\n+CMGL: and ending with \r\n you can use below regular expression :
\\r\\n\+CMGL:.*?\*19\\r\\n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With