近期在做一个项目,涉及到一些简单的规则匹配。规则的判定条件可以用关系表达式描述,形如(P1|P2)&(P3|P4)。其中&是与,|是或,P1-P4是Pattern,具体的匹配条件,返回值是True或者False。为计算此表达式的值,采用中序转后序再计算表达式的值。1. 后序表达式的生成 中序表达式转...
分类:
其他好文 时间:
2015-08-31 00:45:52
阅读次数:
177
使用前提: JavaEE6.0或以上版本 Tomcat7.0或以上版本 新特性: 支持注解取代web.xml配置 本身支持文件上传功能 如何使用这些新特性: 注解: @WebServlet()其中可以配置这个Servlet的Url-pattern,LoadOnStratup...
分类:
其他好文 时间:
2015-08-30 23:40:00
阅读次数:
432
名称grep-打印匹配的行语法:grep[option]pattern[file...]
grep[option][-epattern]|-ffile[file]简介grep就是从文件或者标准输入中搜索你给的样式,默认把匹配到的行打印下来。除grep外,还有其他两个程序可以用,egrep和fgrep。egrep等同于grep-E,frep等同于grep-F。直接使..
分类:
其他好文 时间:
2015-08-30 18:00:57
阅读次数:
216
一、Linux文本处理三剑客:grep:文本过滤工具;sed:文本编辑器(行);streameditorawk:文本报告生成器;Linux上awk的实现为gawkgrep:GlobalsearchREgularexpressionandPrintouttheline.作用:文本搜索工具,根据用户指定的“模式(pattern)”逐行去搜索目标文本,打印匹配到的..
分类:
其他好文 时间:
2015-08-30 17:55:43
阅读次数:
207
grep(缩写来自GloballysearchaRegularExpressionandPrint)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。grep家族包括grep、egrep和fgrep。grep,egrep,fgrep-printlinesmatchingapattern使用方法:grep[OPTIONS]PATTERN[FILE...]grep[OPTIONS]..
分类:
系统相关 时间:
2015-08-30 17:45:43
阅读次数:
230
单例模式 Singleton Pattern确保某一个类只有一个实例, 且自行实例化并向整个系统提供这个实例.相信这个很多人都会,直接代码:class Program { static void Main(string[] args) { Test t = Test.getInstance(); T...
分类:
其他好文 时间:
2015-08-30 17:21:12
阅读次数:
126
使用正则表达式的步骤:
1> 设置匹配模型
NSString *username = @"abcdabcdfgab";//被测试的字符串
NSString *pattern = @"ab";//匹配模型
NSString *patternAnyDigital = @"[0123456789]";
NSString *patternCha...
分类:
其他好文 时间:
2015-08-30 14:26:56
阅读次数:
113
grep和正则表达式的应用Linux文本处理三剑客:grep:文本过滤工具;sed:文本编辑器(行);streameditorawk:文本报告生成器;Linux上awk的实现为gawkgrep:GlobalsearchREgularexpressionandPrintouttheline.作用:文本搜索工具,根据用户指定的“模式(pattern)”逐行去搜索目标..
分类:
系统相关 时间:
2015-08-29 17:14:43
阅读次数:
267
总结本此课程中所涉及命令的使用方法及相关示例展示;grep的使用grep:GlobalsearchREgularexpressionandPrintouttheline.作用:文本搜索工具,根据用户指定的“模式(pattern)”逐行去搜索目标文本,打印匹配到的行;模式:由正则表达式的元字符及文本字符所编写的过滤条件;元..
分类:
其他好文 时间:
2015-08-29 17:13:31
阅读次数:
296
适配器模式 Adapter Pattern 变压器模式Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.将一个类的接口变换...
分类:
其他好文 时间:
2015-08-29 17:02:26
阅读次数:
169