Loading

随笔分类 -  正则表达式

摘要:匹配任意嵌套的html标签[代码]详见:使用正则表达式匹配嵌套Html标签 阅读全文
posted @ 2010-03-11 20:09 .net's 阅读(883) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/// /// check date is validate /// /// /// private bo... 阅读全文
posted @ 2009-01-21 13:08 .net's 阅读(389) 评论(0) 推荐(0)
摘要:对于1个单引号,则转义该单引号 对于1个反斜杠跟1个单引号,则不管它。 对于2个及以上的反斜杠加一个单引号,则分别对每个反斜杠和单引号都进行转义,即 使反斜杠数目保持不变, 并转义单引号。 Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->... 阅读全文
posted @ 2008-11-19 21:43 .net's 阅读(1544) 评论(0) 推荐(0)
摘要:反向引用,指把匹配出来的组引用到表达式本身其它地方,比如,在匹配HTML的标记时,我们匹配出一个<a>,我们要把匹配出来的a引用出来,用来找到</a>,这个时候就要用到反向引用。 语法 a、反向引用编号的组,语法为\number b、反向引用命名的组,语法为\k<name> 举例 a、匹配成对的HTML标签 @"<(?<tag>[^\s>]+)[^>]*... 阅读全文
posted @ 2008-11-16 21:29 .net's 阅读(470) 评论(0) 推荐(0)
摘要:前言 Regular Expressions(正则表达式,以下用RE称呼)对小弟来说一直都是神密的地带,看到一些网络上的大大,简单用RE就决解了某些文字的问题,小弟便兴起了学一学RE的想法,但小弟天生就比较懒一些,总希望看有没有些快速学习的方式,于是小弟又请出Google大神,藉由祂的神力,小弟在网络上找到了Jim Hollenhorst先生的文章,经过了阅读,小弟觉得真是不错,所以就做个小心... 阅读全文
posted @ 2008-11-16 21:17 .net's 阅读(464) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Bad Words Example Enter some text below including "bad... 阅读全文
posted @ 2008-11-16 17:46 .net's 阅读(920) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Trim Example Enter some text containing leading and ... 阅读全文
posted @ 2008-11-16 16:50 .net's 阅读(675) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * 将回车换行分开比较好 * update date:2009-01-01 * */ /// /// 回车 /// ... 阅读全文
posted @ 2008-11-16 14:57 .net's 阅读(876) 评论(3) 推荐(0)
摘要:在asp.net 2.0中可以用split方法 Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->string[] results = input.Split(new char[] { '-', '(', ')' }, StringSpli... 阅读全文
posted @ 2008-10-28 22:42 .net's 阅读(705) 评论(0) 推荐(0)
摘要:Like anchors, lookaround groups match at a certain position rather than certain text. Lookahead will try to look forward at the current position in the string, while lookbehind will try to look back... 阅读全文
posted @ 2008-08-03 20:24 .net's 阅读(417) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System.Text.RegularExpressions; Code Code highlighting produced by Actipro CodeHighli... 阅读全文
posted @ 2008-08-02 23:21 .net's 阅读(1168) 评论(0) 推荐(0)
摘要:The .NET Match and Regex Modes RegexOptions option (?mode) ... 阅读全文
posted @ 2008-08-02 21:16 .net's 阅读(805) 评论(0) 推荐(0)