求助下简单正则"泸州3.41米落"
泸州3.41米落
正则结果希望是"泸州" "3.41" "落"
或 "泸州" "3" "41" "落"
自己测试下:(.*?)(\d*).(\d*)米(.*?),读不到"落",怪了.
希望有人看看。贴个正则式,谢了
------解决方案--------------------(.*?)(\d*).(\d*)米(.*)
*****************************************************************************
http://feiyun0112.cnblogs.com/
------解决方案--------------------str = "泸州3.41米落";
Match m =Regex.Match(str,@"(\w+)(\d+(?:\.\d+)?)米(.*?)(?=$)");
string v1 = m.Groups[1].Value;
string v2 = m.Groups[2].Value;
string v3=m.Groups[3].Value;