网上有很多类似的文章,但往往都不能用 所以记录一下preg_match_all("/([\x{4e00}-\x{9fa5}])/u", $input, $match); 注意:限定代码文件和input字符串都是utf-8编码才可以
分类:
Web程序 时间:
2015-07-30 10:55:18
阅读次数:
149
diff --help -x, --exclude=PAT exclude files that match PAT 排除某个类型的文件 -u, -U NUM, --unified[=NUM] output NUM (default 3) lines of unified context 输...
分类:
其他好文 时间:
2015-07-29 22:54:38
阅读次数:
172
php正则表达式中的非贪婪模式匹配的使用
通常我们会这么写:
$str = "http://www.baidu/.com?url=www.sina.com/";
preg_match("/http:(.*)com/", $str, $matches);
print_r($matches);
结果:
Array ( [0] => http://www.baidu/...
分类:
Web程序 时间:
2015-07-29 10:15:25
阅读次数:
119
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:lay...
分类:
其他好文 时间:
2015-07-29 01:06:54
阅读次数:
203
一:ViewPager和导航点的实现:
主布局为guide.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
...
分类:
移动开发 时间:
2015-07-28 21:05:57
阅读次数:
135
$(function () {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "ipho...
分类:
移动开发 时间:
2015-07-28 18:29:10
阅读次数:
148
#includeusing namespace std;bool match(char *str,char* pattern){ if(*str=='\0'&&*pattern=='\0') return true; if(*str!='\0'&&*pattern=='\0') return f.....
分类:
其他好文 时间:
2015-07-28 10:34:23
阅读次数:
121
Spinner即下拉菜单。在android中实现Spinner组件需要以下三个步骤:1.在XML文件中定义标签Spinner<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>2.在Str...
分类:
其他好文 时间:
2015-07-28 00:53:53
阅读次数:
110
python中出现IndentationError:unindent does not match any outer indentation level今天在网上copy的一段代码,代码很简单,每行看起来该缩进的都缩进了,运行的时候出现了如下错误:
【解决过程】
1.对于此错误,最常见的原因是,的确没有缩进。根据错误提示的行数,去代码中看了下,看起来没有什么问题呀,都有缩进,而且语法也没...
分类:
编程语言 时间:
2015-07-27 21:08:55
阅读次数:
125
关于xml中margin和padding的内容,在刚接触xml的时候会有些混淆和模糊,在此进行总结,希望能帮助到有需要的人。
2.xml中margin和padding
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin...
分类:
移动开发 时间:
2015-07-27 19:12:32
阅读次数:
116