![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
regular expression
book2016
有诸于内,必形于外
展开
-
get the links of google searching result or baidu searching result
function get_google_competition( $data){ preg_match_all(/(.*?)/si, $data, $match); $competition=""; for($i=0; $i preg_match(/href="([^"]*?)"/si, $match[1][$i], $url); $url = $url[1]; $c原创 2008-09-01 09:48:00 · 577 阅读 · 0 评论 -
Perl 中的正则表达式
9 Perl 中的正则表达式正则表达式的三种形式 正则表达式中的常用模式 正则表达式的 8 大原则 正则表达式是 Perl 语言的一大特色,也是 Perl 程序中的一点难点,不过如果大家能够很好的掌握他,就可以轻易地用正则表达式来完成字符串处理的任务,当然在 CGI 程序设计中就更能得心应手了。下面我们列出一些正则表达式书写时的一些基本语法规则。---转载 2009-05-26 09:39:00 · 556 阅读 · 0 评论 -
use regular expression in the oracle sqlplus
SQL> select Customer_id from CUSTOMER_PUBLIC_INFO where regexp_like(customer_id,BJBJ[^123456789]*1$);CUSTOMER_ID----------------------------------------BJBJ00000001oracle 数据库目前内建了符合posix 标准的正则表达式。原创 2008-10-12 15:41:00 · 649 阅读 · 0 评论 -
mysql5.0 support regular expression
I test regular expression in mysql5.0.It work ,the test sentance is below:SELECT fo/nfo REGEXP ^fo$;原创 2008-10-13 10:00:00 · 505 阅读 · 0 评论 -
how to know whether one string is english string
//Clear all cache by below code function sure_en($query_keyword){ $ret_flag=false; preg_match_all(/^([A-Za-z0-9]*?)$/i, $query_keyword, $match); $icount=count($match[1]); if($icount>0) $转载 2008-10-01 22:17:00 · 583 阅读 · 0 评论 -
Use javascript to detect the type of the file
function checkfilename(f){ var fname=f.upfile.value; //正规表达式判断文件类型 var patrn=/^.*/.zip$/; if (!patrn.exec(fname)) { alert("请选取zip文件"); return false; } else return t原创 2008-10-17 11:33:00 · 726 阅读 · 0 评论 -
Get the parameter of webservice xml
{//test1模块处理 Pattern pattern = Pattern.compile(".*?"); Matcher matcher = pattern.matcher(xmlDataFromServer); if(matcher.find()) { //System.out.原创 2008-10-17 10:21:00 · 591 阅读 · 0 评论 -
Get the directory of one php file
$nowdir=$_SERVER["SCRIPT_FILENAME"]; //echo $nowdir.""; /** * The below regulartion will only support windows system, * because in windows system if you use $_SERVER[原创 2008-10-17 10:18:00 · 700 阅读 · 0 评论 -
Use regular expression to find something
1.source data : "s","../xianhua/User_0/ddtj/sdd.jsp "," 订单统计 ", "s","../xianhua/User_0/ddtj/shd.jsp "," 花店统计 ", "s","../xianhua/User_0/ddtj/szx.jsp "," 座席统计 ", "s","../xianhua/User_0/ddtj/ssf.jsp原创 2008-09-10 21:44:00 · 696 阅读 · 0 评论 -
How to change the filenames queque to new filenames
使用拖把更名器软件,可以将一批文件名同时改成我们想要的文件名,最重要的是该软件批量修改文件名时候,支持regular expression原创 2008-09-06 10:47:00 · 576 阅读 · 0 评论 -
use regulator to test regular expression
原创 2008-09-08 16:24:00 · 605 阅读 · 0 评论 -
Use regular expression to get filename from a file full path name.
1.use regular expression to get filename from a file full path name.function get_filename($data){ $preg = ///([^//]*)$/si; preg_match_all($preg, $data, $match); $nlast = count($match[1])原创 2008-09-08 13:39:00 · 961 阅读 · 0 评论 -
Search all jsp filename in the text,but the filename which should not include the symbol '_'
I use Editplus to search,the regular expression is "[^_][^_][^_][^_][^_][^_][^_][^_][^_]jsp",so if the jsp names length is less than 9 and do not have the symbol _ will be show.原创 2008-09-06 10:21:00 · 592 阅读 · 0 评论 -
These regular express are not tested.
正则表达式用于字符串处理、表单验证等场合,实用高效。匹配中文字符的正则表达式: [/u4e00-/u9fa5]评注:匹配中文还真是个头疼的事,有了这个表达式就好办了匹配双字节字符(包括汉字在内):[^/x00-/xff]评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)匹配空白行的正则表达式:/n/s*/r评注:可以用来删除空白行原创 2008-09-02 17:26:00 · 560 阅读 · 0 评论 -
Get phone and email from page
function get_memo_phone($data){ $preg = />.*?(0[0-9]{2,3}/-[0-9][0-9][0-9][0-9].?.?.?.?.?.?[0-9]).*?preg_match_all($preg, $data, $match); $competition=""; $ret=""; for($i=0; $i原创 2008-09-02 16:06:00 · 630 阅读 · 0 评论 -
use regular expression to delete the lines which we don't need
1.目的:用正则表达式删除不需要的行2.原始数据:略3.选用工具:EditPlus4.规则:将^.*~$ 替换为空 ,将尾号为~的行替换为空将^.*bak.*$ 替换为空,将中间含有bak的行替换为空将^.*test.*$ 替换为空,将中间含有test的行替换为空将^.*_[0,9].*$ 替换为空,将中间含有_0到_9的行替换为空将^.*php~.*$ 替换为空,将php~的行原创 2008-09-01 09:48:00 · 572 阅读 · 0 评论 -
正则表达式模式修正符(/ies)
模式修正符 -- 解说正则表达式模式中使用的修正符说明下面列出了当前在 PCRE 中可能使用的修正符。括号中是这些修正符的内部 PCRE 名。修正符中的空格和换行被忽略,其它字符会导致错误。i (PCRE_CASELESS)如果设定此修正符,模式中的字符将同时匹配大小写字母。m(PCRE_MULTILINE)默认情况下,PCRE 将目标字符串作为单一的一“转载 2009-06-19 17:15:00 · 633 阅读 · 0 评论