UltraEdit正则表达式使用示例
1将“澳门,aomen,2;安康,ankang,345;安宁,anning,2742;鞍山,anshan,272;安庆,anqing,42;”转换为如下的结果:
array('name'=>'澳门','busname'=>'aomen','areaid'=>2),
array('name'=>'安康','busname'=>'ankang','areaid'=>345),
array('name'=>'安宁','busname'=>'anning','areaid'=>2742),
array('name'=>'鞍山','busname'=>'anshan','areaid'=>272),
array('name'=>'安庆','busname'=>'anqing','areaid'=>42),
array('name'=>'阿克苏','busname'=>'akesu','areaid'=>3226),
array('name'=>'安阳','busname'=>'anyang','areaid'=>180),
查找
(.*)\,(\w+)\,(.*)\;或者(.*)\,(.*)\,(.*)\;
替换
array('name'=>'\1','busname'=>'\2','areaid'=>\3),^r^n
array('name'=>'\1','busname'=>'\2','areaid'=>\3),
2替换PHP标签为{}:如为{$catstr}
查找
<\?\=(\S+)\?>
替换
{\1}
$tag_cache = false; $db_cache = ($expires == -2 || defined('TOHTML')) ? 'CACHE' : ''; if($tag_expires && $db_cache != 'CACHE' && strpos($parameter, '&page=') === false) { $tag_cache = true; $TCF = DT_CACHE.'/tag/'.md5($parameter).'.htm'; if(is_file($TCF) && ($DT_TIME - filemtime($TCF) < $tag_expires)) { echo substr(file_get($TCF), 17); return; } } $parameter = str_replace(array('&', '%'), array('', '##'), $parameter); $parameter = strip_sql($parameter); parse_str($parameter, $par); if(!is_array($par)) return ''; $par = dstripslashes($par); extract($par, EXTR_SKIP); isset($prefix) or $prefix = $db->pre; isset($moduleid) or $moduleid = 1; if(!isset($MODULE[$moduleid])) return ''; isset($fields) or $fields = '*'; isset($catid) or $catid = 0; isset($child) or $child = 1; isset($areaid) or $areaid = 0; isset($areachild) or $areachild = 1; (isset($dir) && check_name($dir)) or $dir = 'tag'; (isset($template) && check_name($template)) or $template = 'list'; isset($condition) or $condition = '1'; isset($group) or $group = ''; isset($page) or $page = 1; isset($offset) or $offset = 0; isset($pagesize) or $pagesize = 10; isset($order) or $order = ''; isset($showpage) or $showpage = 0; isset($showcat) or $showcat = 0; isset($datetype) or $datetype = 0;
相关推荐
wangzhaotongalex 2020-10-20
wyq 2020-11-11
TLROJE 2020-10-26
风雨断肠人 2020-10-13
duanqingfeng 2020-09-29
rechanel 2020-11-16
cshanzhizi 2020-10-16
luofuIT成长记录 2020-09-22
phphub 2020-09-10
taomengxing 2020-09-07
MaggieRose 2020-08-19
flyingssky 2020-08-18
山水沐光 2020-08-18
jyj00 2020-08-15
AHuqihua 2020-08-09
山水沐光 2020-08-03