hey all,
i'm trying to get Color information that i've stored in a text file and then use that color as the forecolor for a label. BUT, at run time when i click the button to do it, it doesnt give me any error messages or anything. the code i have is below:
MatchCollection lines = Regex.Matches(File.ReadAllText(Path), @"(.+?)\r\n""([^""]+)""\r\n(\d+),\s(\d+)\r\n([\w\s]*)\r\n(\d+\.\d+)""\r\n(\d+?)");
foreach (Match match in lines)
int color = Int32.Parse(match.Groups[5].Value);
I have other regex for other info inn files too, but the other regex isnt the problem. the problem is the regex that i have just added to try and match a color (argb). it's at the end of the string:
\r\n(\d+?)
So as far as I understand it, the above little regex thing means this: "Find a carriagereturn and newline, and then 1 or more digits but dont be greedy". is that right?
can somebody please help me with this. thank you very much.
Note: The color info that is saved in the text file is a negative number (ARGB color):
-16744193
The file contents is like this:
Control
Control Text
Control Location
Control Font Name
Control Font Size
Control Font Color
Explanation:
Label
"this is a label"
23, 77
Tahoma
14.0
-55794414
So, the regex works, it gets all the other details correctly but it just doesnt get the color information.