Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
其他好文 时间:
2014-08-14 19:44:09
阅读次数:
134
中国足球的水平虽然不高,但实际上,在每个城市会有一批足球爱好者,他们踢球、看球、懂球。有这样的2个足球爱好者,一个是左脚选手,另一个是右脚选手。 public class PlayWithLeft { public void Play() { Console.WriteLine("我是左脚选手");...
分类:
其他好文 时间:
2014-08-14 19:41:59
阅读次数:
197
String content = “testContent”; String regex="^[a-zA-Z0-9\u4E00-\u9FA5]+$"; Pattern pattern = Pattern.compile(regex); Matcher ma...
分类:
编程语言 时间:
2014-08-14 19:41:29
阅读次数:
282
ANT通配符有三种:通配符说明?匹配任何单字符*匹配0或者任意数量的字符**匹配0或者更多的目录例子:URL路径说明/app/*.x匹配(Matches)所有在app路径下的.x文件/app/p?ttern匹配(Matches) /app/pattern 和 /app/pXttern,但是不包括/a...
分类:
其他好文 时间:
2014-08-14 19:22:19
阅读次数:
336
??????简单工厂模式解释: 简单工厂模式(Simple Factory Pattern)属于类的创新型模式,又叫静态工厂方法模式(Static FactoryMethod Pattern),是通过专门定义一个类来负责创建其它类的实例,被创建的实例通常都具有共同的父类。简单工厂模式的UML图: 简...
分类:
其他好文 时间:
2014-08-14 16:32:08
阅读次数:
185
1、js数字格式化/*** 格式化数字* formatNumber(12345.999,'#,##0.00')* formatNumber(12345.999,'#,##0.##')* formatNumber(123,'000000');* @param num* @param pattern*/...
分类:
其他好文 时间:
2014-08-14 13:55:08
阅读次数:
176
1、定义模板方法模式(Template Method Pattern),定义一个操作中的算法的框架,而将一些步骤延迟到子类中。使得子类可以不改变一个算法的结构即可重定义该算法的某些特定步骤。2、通用类图AbstractClass 叫抽象模板,它的方法分为两类:基本方法、模板方法基本方法:基本方法也叫...
分类:
其他好文 时间:
2014-08-14 13:54:48
阅读次数:
173
int preg_match(string $pattern, string $subject[, $arr][, int $flags]);$pattern 正则表达式$subject: 要搜索的字符串$arr: 成功返回存放的数组返回值:匹配不成功为 0,否则为 1$arr[0]: 为包含与整个...
分类:
其他好文 时间:
2014-08-14 13:47:18
阅读次数:
180
$username ="你好";$pattern = '/^[\x{4e00}-\x{9fa5}]{2,20}$/u';$res = preg_match($pattern,$username);var_dump($res);
分类:
Web程序 时间:
2014-08-14 01:03:27
阅读次数:
218
public static void main(String[] args) { String regex = ""; Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); String content = ""; Matc...
分类:
编程语言 时间:
2014-08-13 18:25:47
阅读次数:
227