[Mono-list] Re gular Expressions incompatibility

dave31836 dlnelson at gmail.com
Sat Jan 10 09:16:21 EST 2009




dave31836 wrote:
> 
> Thje following code works under windows, but fails under Mono:
> 
> //convert date from yyyy-mm-dd to mm/dd/yy
> string p5 = @"(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)";
> Match m5 = Regex.Match(date, p5);
> if (m5.Success)
> {
> 	string year = m5.Groups[1].ToString();
> 	string month = m5.Groups[2].ToString();
> 	string day = m5.Groups[3].ToString();
> 	string hour = m5.Groups[4].ToString();
> 	string min = m5.Groups[5].ToString();
> 	string sec = m5.Groups[6].ToString();
> 	string newdate = string.Format("{0:00}/{1:00}/{2:00}
> {3:00}:{4:00}:{5:00}", month, day, year, hour, min, sec);
> 	Console.WriteLine("Result: " + assertion);
> }
> 
> Any suggestions appreciated.
> 
disregard this... my input string was bad.....
-- 
View this message in context: http://www.nabble.com/Regular-Expressions-incompatibility-tp21388320p21388532.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list