1. preg_match()函数 preg_match()函数在字符串中搜索模式,如果存在则返回true,否则返回false $pattern='/php/'; $str='php100.com'; echo preg_match($pattern,$str); 输出结果:12. preg_g.....
分类:
Web程序 时间:
2014-10-08 14:36:45
阅读次数:
214
package week01;import java.util.regex.Matcher;import java.util.regex.Pattern;/**** * * 字符串帮助类 * @author csharper * @since 2014.10.08 * */public class....
分类:
其他好文 时间:
2014-10-08 13:24:35
阅读次数:
152
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
其他好文 时间:
2014-10-08 11:12:55
阅读次数:
249
代理模式(Composite):代理模式其实就是多一个代理类出来,替原对象进行一些操作。比如咱有的时候打官司需要请律师,因为律师在法律方面有专长,可以替咱进行操作表达咱的想法,这就是代理的意思。代理模式分为两类:1、静态代理(不使用jdk里面的方法);2、动态代理(使用jdk里面的InvocationHandler和Proxy)。下面请看示例:...
分类:
编程语言 时间:
2014-10-07 21:35:14
阅读次数:
227
设置1:build project的时候,让编译器支持 三字母词。
项目文件右击--> Properties-->C/C++ Build--> Settings 如图设置:
再 Command line pattern 如图的位置加上 -ansi 或者 -trigraphs 即可。
现在可以尝试下 加 和 不加 这个参数下面代码的执行效果: printf("delete files? ...
分类:
编程语言 时间:
2014-10-07 19:34:23
阅读次数:
222
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2014-10-07 15:21:03
阅读次数:
236
java代码:注:打包的时候一个依赖jar都不要。import java.util.Arrays;import java.util.List;import java.util.regex.Pattern;import org.apache.hadoop.io.IntWritable;import o...
分类:
其他好文 时间:
2014-10-07 14:59:43
阅读次数:
200
??????简单工厂模式解释: 简单工厂模式(Simple Factory Pattern)属于类的创新型模式,又叫静态工厂方法模式(Static FactoryMethod Pattern),是通过专门定义一个类来负责创建其它类的实例,被创建的实例通常都具有共同的父类。简单工厂模式的UML图: 简...
分类:
其他好文 时间:
2014-10-06 23:48:51
阅读次数:
243
public static boolean includingNUM(String str)throws Exception{Pattern p = Pattern.compile("[\u4e00-\u9fa5]*[\\d|\\w]+[\u4e00-\u9fa5]*");//或者 Pattern ...
分类:
编程语言 时间:
2014-10-06 23:11:51
阅读次数:
262
前一篇关于代理模式的博文中详细介绍了远程代理,本篇将补充一些其它代理(虚拟代理、保护代理、防火墙代理……)
分类:
其他好文 时间:
2014-10-06 21:45:20
阅读次数:
221