-2

how can can i do this ? i can't get the return value and i can understand how regex work .

 string value = "+CMT:"+639231568462"," ","18/10/07,14:31:32+32" HELLO"
    ";
    Regex r = new Regex("");
    Match m = r.Match(value);

    while(m.Success)
    {
          string number = m.Group[0].toString();
          string Date = m.Group[1].toString();
          string Time = m.Group[2].toString();
          string Mesage= m.Group[3].toString();

    }

OUTPUT

number = +639231568462;
date = 18/10/07;
time = 14:31:32;
message = HELLO;
miracle173
  • 7,662
  • 25
  • 41
  • 3
    this question is about c# and regular expression, but it is not database related. So it is off topic here. Maybe it is suitavle for https://stackoverflow.com/ – miracle173 Oct 07 '18 at 11:18

1 Answers1

1

First your string is not valid. This will display compile time errors in your IDE

for simply parsing text you can use the split() method.

 string[] a = value.Split(',');

see this fiddle : https://dotnetfiddle.net/0amHEP

comphonia
  • 111
  • 1