Reputation: 25
I want to filter the following strings using Regular expression in C#.
+CUSD: 2,"Your account balance is BDT 00.00 valid till 02/05/14. Dial *789*1*1# to get daily General Health Tips,Charge Tk 1.73/SMS", 15
+CUSD: 1,"1 Call Block
2 Mobile Service
3 Infotainment
4 Recharge
5 Roaming
6 Internet
7 Product & Promotion
8 Account Info
9 GP STAR", 15
The first one is single line. Second one is multiline.
Regex regex1 = new Regex("\\+CUSD: (\\d+),\"(.*?)\", (\\d+)\\r\\n", RegexOptions.Multiline);
This Filter the first string but not the other.
What will be the common filter for both string?
Upvotes: 1
Views: 271
Reputation: 2427
Consider the following Regex...
\+CUSD: (\d+),\"[\s\S]*?\", (\d+)
Good Luck!
Upvotes: 0