I have this
var regex = new Regex(@"StartDate:(.*)EndDate:(.*)W.*Status:(.*)");
So this gets me values until it hits a W in the string correct? - I need it to stop at a W OR S. I have tried a few different ways but I am not getting it to work. Anyone got some info?
More info:
record = record.Replace(" ", "").Replace("\r\n", "").Replace("-", "/");
var regex = new Regex(@"StartDate:(.*)EndDate:(.*)W.*Status:(.*)");
string strStartDate = regex.Match(record).Groups[1].ToString();
string strEndDate = regex.Match(record).Groups[2].ToString();
string Status = regex.Match(record).Groups[3].ToString().ToUpper().StartsWith("In") ? "Inactive" : "Active";
I am trying to parse a big string of values, I only want 3 things - Start Date, End Date, and Status (active/inactive). However there are 3 different values for each (3 start dates, 3 end dates, 3 status')
First 2 string go like this
"Start Date:
2014-09-08
End Date:
2017-09-07
Warranty Type:
XXX
Status:
Active
Serial Number/IMEI:
XXXXXXXXXXX
Description:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
The 3rd string is like this
"Start Date:
2014-09-08
End Date:
2017-09-07
Status:
Active
Warranty Upgrade Code:
SVC_PRIORITY"
On the last string it will not display the dates because of the W.* after end date im guessing
I am not getting the 2 dates on the last string


:+space?