.net正则提取手机号码,并替换带有手机号码的a标签
//用正则查找字符串中的手机号码,最后替换成带a标签的可打电话的字符串 var str = "收件人:江苏省苏州市工业园区屌丝大叔收,电话:18688888888"; var result = Regex.Replace(str, "(1[3|4|5|6|7|8|9][0-9]{9})", "<a href=\"tel:$1\">$1</a>");//<a href="tel:18688888888">拨号</a>
//用正则查找字符串中的手机号码,最后替换成带a标签的可打电话的字符串 var str = "收件人:江苏省苏州市工业园区屌丝大叔收,电话:18688888888"; var result = Regex.Replace(str, "(1[3|4|5|6|7|8|9][0-9]{9})", "<a href=\"tel:$1\">$1</a>");//<a href="tel:18688888888">拨号</a>