<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class ReUtil { public static function group($Q9mGn, $WKfeb, $yex8L) { try { if (preg_match($Q9mGn, $WKfeb, $H_mB1)) { return $H_mB1[$yex8L]; } } catch (\Exception $Xlb8r) { } return null; } public static function group0($Q9mGn, $WKfeb) { try { return self::group($Q9mGn, $WKfeb, 0); } catch (\Exception $Xlb8r) { } return null; } public static function group1($Q9mGn, $WKfeb) { try { return self::group($Q9mGn, $WKfeb, 1); } catch (\Exception $Xlb8r) { } return null; } public static function isWildMatch($N1LGT, $WKfeb) { goto NGXlt; BWwiX: return preg_match($Q9mGn, $WKfeb); goto Dnm96; UuHuS: $Q9mGn = '/^' . preg_quote($N1LGT, '/') . '$/'; goto Chaq4; NGXlt: $N1LGT = str_replace('*', '__x__star__', $N1LGT); goto UuHuS; Chaq4: $Q9mGn = str_replace('__x__star__', '.*', $Q9mGn); goto BWwiX; Dnm96: } public static function replace($vVYCS, $Q9mGn, $b9NqF) { goto PAB6Y; PAB6Y: preg_match_all($Q9mGn, $vVYCS, $H_mB1); goto ItDxe; ItDxe: foreach ($H_mB1[0] as $kM8qX => $Xz28r) { goto hzjl4; hzjl4: $hcOFW = array_map(function ($zcQlf) use($kM8qX, $H_mB1) { return $zcQlf[$kM8qX]; }, $H_mB1); goto N8DK_; N8DK_: $V2Jt7 = call_user_func_array($b9NqF, array($hcOFW)); goto cuq8K; cuq8K: $vVYCS = str_replace($Xz28r, $V2Jt7, $vVYCS); goto ZyXfM; ZyXfM: } goto Fps9s; Fps9s: return $vVYCS; goto I8miu; I8miu: } }