how can I convert this string:
bKk_035A_paint-House_V003
to
BKK_035a_paint-House_v003
with a regular expression (e.g. Regex.R
the Regex doesn't match the first string...
I assume you want the first 3 chars upper case, and the rest lowercase?
here's a first pass:
const string mod = @"^([a-z][a-z0-9]{1,2})(_\d{3}[a-z]{0,2}_[a-z]+_v{1}\d{3,5})$";
var converted =
new Regex(mod, RegexOptions.IgnoreCase)
.Replace(input1,
m => string.Format(
"{0}_{1}",
m.Groups[1].ToString().ToUpper(),
m.Groups[2].ToString().ToLower()
)
);