c# Regex Help
-
I have a string of the form
"[1,'#000000','#ffffff'],"
I need to extract the '1' as an int, '#000000' as a System.Drawing.Color, and '#ffffff' as a System.Drawing.Color. I don't want to do repeatedIndexOf(",")
calls to get them, and regex appears to be the way to do this. I have looked on some tutorials and cannot work out how to do this. How do I extract these 3 variables from the string with Regex? -
I have a string of the form
"[1,'#000000','#ffffff'],"
I need to extract the '1' as an int, '#000000' as a System.Drawing.Color, and '#ffffff' as a System.Drawing.Color. I don't want to do repeatedIndexOf(",")
calls to get them, and regex appears to be the way to do this. I have looked on some tutorials and cannot work out how to do this. How do I extract these 3 variables from the string with Regex?at the beginning and end
only two letters away from being an asset
-
I have a string of the form
"[1,'#000000','#ffffff'],"
I need to extract the '1' as an int, '#000000' as a System.Drawing.Color, and '#ffffff' as a System.Drawing.Color. I don't want to do repeatedIndexOf(",")
calls to get them, and regex appears to be the way to do this. I have looked on some tutorials and cannot work out how to do this. How do I extract these 3 variables from the string with Regex? -
I have a string of the form
"[1,'#000000','#ffffff'],"
I need to extract the '1' as an int, '#000000' as a System.Drawing.Color, and '#ffffff' as a System.Drawing.Color. I don't want to do repeatedIndexOf(",")
calls to get them, and regex appears to be the way to do this. I have looked on some tutorials and cannot work out how to do this. How do I extract these 3 variables from the string with Regex?How about
\[(\d+),'#([0-9A-Fa-f]{6,6})','#([0-9A-Fa-f]{6,6})'\]
? Tested with my RegexTester[^] :-D .modified on Monday, August 31, 2009 12:03 AM