正则表达式 常用

 

 字符串只保留数字和小数点(原地址:https://zhidao.baidu.com/question/2076718713109720948.html)

'¥100,000.00'.replace(/[^\d.]/g,'')

 

 

MatchCollection mc = Regex.Matches(Content, "dt.Rows[\\s\\S]*?.ToString()");

 

 

MatchCollection mc = Regex.Matches("   map_Ka daolutietu你哈.png", "\\s([0-9a-zA-Z_\u4E00-\u9FA5]*?.(jpg|gif|png|bmp))");

 

 

MatchCollection mc = Regex.Matches("    map_Ka /Upload/附件/桥梁/23/模型/daolutietu.png", "\\s([\\/_0-9a-zA-Z\u4E00-\u9FA5]*?.(jpg|gif|png|bmp))");
//匹配规则 / _ 数字 小写字母 大写字母 中文 最小匹配 . jpg|gif|png|bmp其中的一种图片

 

posted @ 2018-09-27 10:33  古兴越  阅读(141)  评论(0编辑  收藏  举报