原文符号
因为"htmlcode">
string pattern1 = @"a.*c"; // greedy match Regex regex = new Regex(pattern1); regex.Match("abcabc"); // return "abcabc"
非贪婪匹配
在满足匹配时,匹配尽可能短的字符串,使用"htmlcode">
string pattern1 = @"a.*"; // non-greedy match Regex regex = new Regex(pattern1); regex.Match("abcabc"); // return "abc"
几个常用的非贪婪匹配Pattern
*"htmlcode">
while(<>){ if(/("Fred wants a $1\n" ; } }
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“正则表达式问号的四种用法详解”评论...