<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class XKeywordsUtil { public static function match($R5QVI, $gP2DQ, &$OnC1v = null) { goto k1kOj; e0PLI: return false; goto gW5_0; utrk0: foreach ($xOkS0 as $P1uVJ) { goto qcWiQ; tR5mk: if (false !== strpos($gP2DQ, $P1uVJ)) { $OnC1v = $P1uVJ; return true; } else { if (substr($P1uVJ, 0, 1) === '@') { if (@preg_match('/' . substr($P1uVJ, 1) . '/', $gP2DQ)) { $OnC1v = $P1uVJ; return true; } } else { if (false !== strpos($P1uVJ, ' ')) { goto ReNoF; sLqn3: foreach (explode(' ', $P1uVJ) as $lxIPA) { if (false === strpos($gP2DQ, $lxIPA)) { $wh5kp = false; break; } } goto FnTUy; FnTUy: if ($wh5kp) { $OnC1v = $P1uVJ; return true; } goto dsiLR; ReNoF: $wh5kp = true; goto sLqn3; dsiLR: } else { if (preg_match('/((\\*)(\\d+))[^\\d]/', $P1uVJ, $YANPA)) { goto dEoNq; oZXA4: if (@preg_match($nG6Jq, $gP2DQ)) { $OnC1v = $P1uVJ; return true; } goto BROri; ErSg0: $nG6Jq = '/' . preg_quote($aju03[0]) . '.{3,' . $YANPA[3] * 3 . '}' . preg_quote($aju03[1]) . '/'; goto oZXA4; dEoNq: $aju03 = explode($YANPA[1], $P1uVJ); goto ErSg0; BROri: } else { if (false !== strpos($P1uVJ, '*')) { goto wx95S; sxMxP: $nG6Jq = '/' . preg_quote($aju03[0]) . '.+' . preg_quote($aju03[1]) . '/'; goto hbqAx; wx95S: $aju03 = explode('*', $P1uVJ); goto sxMxP; hbqAx: if (@preg_match($nG6Jq, $gP2DQ)) { $OnC1v = $P1uVJ; return true; } goto GpC3P; GpC3P: } } } } } goto Kl0j3; qcWiQ: $P1uVJ = trim($P1uVJ); goto Rum21; Rum21: if (empty($P1uVJ)) { continue; } goto tR5mk; Kl0j3: } goto e0PLI; k1kOj: $R5QVI = trim($R5QVI); goto rPXwL; B7mvc: $xOkS0 = str_replace(',', '
', $R5QVI); goto vLaKZ; vLaKZ: $xOkS0 = explode('
', $xOkS0); goto utrk0; rPXwL: if (empty($R5QVI) || empty($gP2DQ)) { return false; } goto B7mvc; gW5_0: } public static function descriptionHtml() { return '<pre class=\'ub-content-bg\'>' . self::description() . '</pre>'; } public static function description() { $uujLm = '关键词匹配说明
· 简单包含匹配: "你好" 匹配 "你好"多条使用,分割
· 忽略顺序同时包含匹配: "你 好" 匹配 "你们好"、"你们好"、"很好你们"
· 顺序同时包含匹配: "你*好" 匹配 "你们好"、"你们很好"，*匹配一个或多个字
· 顺序限定同时包含匹配: "你*1好" 匹配 "你们好"，不能匹配"你们很好"，数字表示最长多少个汉字字符，1个汉字=3英文字母
· 正则表达式匹配："@正则表达式" 匹配 "正则表达式"，@开头表示正则表达式
使用说明
· 多个正则使用半角逗号(,)或换行分割'; return $uujLm; } public static function test() { goto Y2DXQ; H1rCd: return join('
', $VPJ9O); goto WNfoy; z8ZwC: for ($jqibn = 0; $jqibn < count($nvtyv); $jqibn += 2) { $VPJ9O[] = sprintf('%-10s%-20s%s', $nvtyv[$jqibn], $nvtyv[$jqibn + 1], SerializeUtil::jsonEncode(self::match($nvtyv[$jqibn], $nvtyv[$jqibn + 1]))); } goto H1rCd; lYyop: $VPJ9O = array(); goto z8ZwC; Y2DXQ: $nvtyv = array('你好', '你好', '你好', '你们好', '你 好', '你们好', '你*好', '你们好', '你*1好', '你们好', '你*1好', '你们很好', '你*2好', '你们很好', '@你们', '你们很好', '@你好', '你们很好'); goto lYyop; WNfoy: } }