金光 发表于 2005 年 10 月 8 日 15:45:45

正则表达式例子:在一个字符串中查找另一个字符串

正则表达式返回列表 method=post>在>中查找>>第二个字符串可以在第一个字符串的任何位置>第一个字符串以第二个字符串开
始>第一个字符串以第二个字符串结束>区分大小写 and $query){if(isset($case)){$func = ereg;}else{$func = eregi;}
switch($where){case ^:$query = ^ . $query;break;case $:$query .= $;break;}eval(\$found = $func(\$query\,\$string
\););if($found){echo 找到!;}else{echo 未找到!;}}?>


转自:http://edu.chinaz.com

金光 发表于 2005 年 10 月 8 日 15:45:45

正则表达式例子:在一个字符串中查找另一个字符串

正则表达式返回列表 method=post>在>中查找>>第二个字符串可以在第一个字符串的任何位置>第一个字符串以第二个字符串开
始>第一个字符串以第二个字符串结束>区分大小写 and $query){if(isset($case)){$func = ereg;}else{$func = eregi;}
switch($where){case ^:$query = ^ . $query;break;case $:$query .= $;break;}eval(\$found = $func(\$query\,\$string
\););if($found){echo 找到!;}else{echo 未找到!;}}?>


转自:http://edu.chinaz.com
页: [1]
查看完整版本: 正则表达式例子:在一个字符串中查找另一个字符串