<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class ReUtil { public static function group($lwMrL, $d1mrX, $GMVoY) { try { if (preg_match($lwMrL, $d1mrX, $EbeBB)) { return $EbeBB[$GMVoY]; } } catch (\Exception $tZVhb) { } return null; } public static function group0($lwMrL, $d1mrX) { try { return self::group($lwMrL, $d1mrX, 0); } catch (\Exception $tZVhb) { } return null; } public static function group1($lwMrL, $d1mrX) { try { return self::group($lwMrL, $d1mrX, 1); } catch (\Exception $tZVhb) { } return null; } public static function isWildMatch($hFZ3E, $d1mrX) { goto ZO1Tv; ZO1Tv: $hFZ3E = str_replace('*', '__x__star__', $hFZ3E); goto rCYGs; SlrMH: $lwMrL = str_replace('__x__star__', '.*', $lwMrL); goto Y6RMI; Y6RMI: return preg_match($lwMrL, $d1mrX); goto sBscs; rCYGs: $lwMrL = '/^' . preg_quote($hFZ3E, '/') . '$/'; goto SlrMH; sBscs: } public static function replace($LTC5O, $lwMrL, $yeJzO) { goto cHAgT; Uh7eZ: return $LTC5O; goto ncq1s; cHAgT: preg_match_all($lwMrL, $LTC5O, $EbeBB); goto nXJz0; nXJz0: foreach ($EbeBB[0] as $Xn_Rr => $pk5fc) { goto EsWi8; EsWi8: $KWrRN = array_map(function ($Qa0pH) use($Xn_Rr, $EbeBB) { return $Qa0pH[$Xn_Rr]; }, $EbeBB); goto q1rJT; q1rJT: $MS0rN = call_user_func_array($yeJzO, array($KWrRN)); goto vxDwL; vxDwL: $LTC5O = str_replace($pk5fc, $MS0rN, $LTC5O); goto OzddY; OzddY: } goto Uh7eZ; ncq1s: } }