110,502
社区成员
发帖
与我相关
我的任务
分享
string JoinedFootUnits = "foots|foot|feets|feet|ft|f|\"";
string JoinedInchUnits = "inches|inchs|inch|in|i|\'";
string pattern = @" \b
(?<footHeight>(\d+))
(\s*)
(?<footUnit>[" + JoinedFootUnits + @"]{1})
(\s*)
(?<inchHeight>\d+)*
(\s*)
(?<inchUnit>[" + JoinedInchUnits + @"])*
\b
";
Regex regex = new Regex(pattern, RegexOptions.IgnorePatternWhitespace);
Match match = regex.Match(height);
Regex re=new Regex("[a-z]");
re.Replace(string,"");