Q:

c# list of strings > sort by regex ? 

I am quite new to c# but I can't resolve this issue ( most probably a simple one ). 
I have 2 List that contain strings of error logs. (  Let me know if it's better to use an array of strings )
/* Example of list from host 1
2017-06-29 02:25:54.309 BST,ERROR,.......
2017-06-29 02:25:54.357 BST,ERROR,.......
2017-06-29 02:25:54.495 BST,ERROR,.......
2017-06-29 02:30:57.183 BST,ERROR,.......
2017-06-29 03:07:12.078 BST,ERROR,.......
2017-06-29 05:07:13.256 BST,ERROR,.......
2017-06-29 05:14:14.717 BST,ERROR,.......
2017-06-29 05:16:23.954 BST,ERROR,.......
2017-06-29 08:12:16.418 BST,ERROR,.......
2017-06-29 08:37:23.574 BST,ERROR,.......
2017-06-29 09:07:11.569 BST,ERROR,....... */
List<string> filteredLogFileC1 = filterLog(hostNameC1); //filterLog returns a List<string>

/* Example of list from host 2
2017-06-29 00:43:43.781 BST,ERROR,.......
2017-06-29 00:43:44.446 BST,ERROR,.......
2017-06-29 00:43:44.885 BST,ERROR,.......
2017-06-29 00:43:45.378 BST,ERROR,.......
2017-06-29 00:43:45.940 BST,ERROR,.......
2017-06-29 00:43:46.584 BST,ERROR,.......
2017-06-29 00:43:47.141 BST,ERROR,....... */ 
List<string> filteredLogFileC2 = filterLog(hostNameC2); //filterLog returns a List<string>

// Combine the 2 lists into one (the below practice might not be the best one but its working and I am happy at the moment :) )

/*
... Combined list
2017-06-29 08:12:16.418 BST,ERROR,.......
2017-06-29 08:37:23.574 BST,ERROR,.......
2017-06-29 09:07:11.569 BST,ERROR,....... 
2017-06-29 00:43:43.781 BST,ERROR,.......
2017-06-29 00:43:44.446 BST,ERROR,.......
2017-06-29 00:43:44.885 BST,ERROR,.......
...
*/
foreach (string line in filteredLogFileC2) filteredLogFileC1.Add(line);

// I need to sort the filteredLogFileC1 list by date. 
// Below I have a regex that I've put together but I don't know how I can use it 

Regex sortReg = new Regex(@"(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}.\d{3})");

Issue: filteredLogFileC1.OrderBy( ??? sortReg??? ) 

Thank you for your suggestions. 

A:

If I understood your task right - this can be:
filteredLogFileC1.Union(filteredLogFileC2).OrderBy(l => sortReg. Match(l).Value)

The code result is IEnumerable.  You can use an extension method .ToList() to converti it.  Also, if Regex fails to match - the result value will be an empty string else it will be the desired substring.