<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class ReUtil { public static function group($vGndt, $MLXrV, $f3O4U) { try { if (preg_match($vGndt, $MLXrV, $i5sAZ)) { return $i5sAZ[$f3O4U]; } } catch (\Exception $SXS9c) { } return null; } public static function group0($vGndt, $MLXrV) { try { return self::group($vGndt, $MLXrV, 0); } catch (\Exception $SXS9c) { } return null; } public static function group1($vGndt, $MLXrV) { try { return self::group($vGndt, $MLXrV, 1); } catch (\Exception $SXS9c) { } return null; } public static function isWildMatch($kP_A6, $MLXrV) { goto Ms9ih; Ms9ih: $kP_A6 = str_replace('*', '__x__star__', $kP_A6); goto VgXqp; VgXqp: $vGndt = '/^' . preg_quote($kP_A6, '/') . '$/'; goto Jfr0p; ShG_9: return preg_match($vGndt, $MLXrV); goto mmc14; Jfr0p: $vGndt = str_replace('__x__star__', '.*', $vGndt); goto ShG_9; mmc14: } public static function replace($rFmqf, $vGndt, $r1VBm) { goto hg5zy; hg5zy: preg_match_all($vGndt, $rFmqf, $i5sAZ); goto SW_R4; vYWd2: return $rFmqf; goto HZHMF; SW_R4: foreach ($i5sAZ[0] as $eQWJY => $tHq0l) { goto SrYvr; wvBpG: $rFmqf = str_replace($tHq0l, $eZ6pL, $rFmqf); goto acutL; F81Mr: $eZ6pL = call_user_func_array($r1VBm, array($PBpDU)); goto wvBpG; SrYvr: $PBpDU = array_map(function ($xZ9fp) use($eQWJY, $i5sAZ) { return $xZ9fp[$eQWJY]; }, $i5sAZ); goto F81Mr; acutL: } goto vYWd2; HZHMF: } }