| re: String parser Using Regular Expression for Date format display using Locale Settings)
I'm still pretty new to regex so this is going to be sloppy and
probably not the easiest way if it even works, but I would use
something like this after you match it:
string bdate = Regex.Match(val, "\d+/\d+/\d+").Value;
string month = Regex.Match(val, "^\d+/").Value;
string day = Regex.Match(val, "/\d+/")Value;
string year = Regex.Match(val, "/\d{4}").Value;
I'm not sure if this will work, but if it does as i intend it to,
you'll have a separate string for each part of the date, which you can
then order based on whichever d/t format you're working with. If this
doesn't work (I can't try it atm as i'm working on another project,
well, supposed to be at least) then you're going to have to make some
substrings, let me know, and if you still need help i'll take a better
stab at it. |