近日在和朋友讨论 maskmatch 时偶得2个不错的算法。
函数1 只支持'*','?'模糊匹配。速度比采用递归算法的快近2倍,比tmask方法快很多。
函数2 完全支持正规表达式。速度于之前的相同。(不会正规表达式的朋友慎用)
| // =========================== // function 1 // =========================== // check if the string can match the wildcard. it can be used for unicode strings as well! |
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器