I am trying to match the below text using Regex,
"1bbl" 2bbl "is as" 0.22 "3"
When I match I am not getting the output as expected in my list.
string val = "\"1bbl\" 2bbl \"is as\" 0.22 \"3\"";
var reg = new Regex(@"([a-z0-9\s]+)");
Match match = reg.Match(val);
List<string> list = new List<string>();
while (match.Success)
{
list.Add(match.ToString());
match = match.NextMatch();
}
Current Output:
"1bbl"
" 2bbl "
"is as"
" 0"
"22 "
"3"
Expected Output:
"1bbl"
"2bbl"
"is as"
"0.22"
"3"