From 97b29e6ffd85a679fd65519ee17ce3ce54cd43b6 Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Fri, 26 Aug 2022 14:20:16 +0800 Subject: =?UTF-8?q?:put=5Flitter=5Fin=5Fits=5Fplace:=20Remove:=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=20Pangu.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 因为需要这个功能的人不多,就算需要,那些需要的人大部分也已经养成手打空格的习惯了(比如我 --- libs/Matcha.php | 3 +- libs/Pangu.php | 112 -------------------------------------------------------- 2 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 libs/Pangu.php (limited to 'libs') diff --git a/libs/Matcha.php b/libs/Matcha.php index 3d28ff9..ef49b0b 100644 --- a/libs/Matcha.php +++ b/libs/Matcha.php @@ -1,6 +1,5 @@ array( - '([' . $cjk . '])(["\'])', - '$1 $2' - ), - - 'quote_cjk' => array( - '(["\'])([' . $cjk . '])', - '$1 $2' - ), - - 'fix_quote' => array( - '(["\']+)(\s*)(.+?)(\s*)(["\']+)', - '$1$3$5' - ), - - 'cjk_hash' => array( - '([' . $cjk . '])(#(\S+))', - '$1 $2' - ), - - 'hash_cjk' => array( - '((\S+)#)([' . $cjk . '])', - '$1 $3' - ), - - 'cjk_operator_ans' => array( - '([' . $cjk . '])([A-Za-zΑ-Ωα-ω0-9])([\+\-\*\/=&\\|<>])', - '$1 $2 $3' - ), - - 'ans_operator_cjk' => array( - '([\+\-\*\/=&\\|<>])([A-Za-zΑ-Ωα-ω0-9])([' . $cjk . '])', - '$1 $2 $3' - ), - - 'bracket' => array( - array( - '([' . $cjk . '])([<\[\{\(]+(.*?)[>\]\}\)]+)([' . $cjk . '])', - '$1 $2 $4' - ), - - array( - 'cjk_bracket' => array( - '([' . $cjk . '])([<>\[\]\{\}\(\)])', - '$1 $2' - ), - - 'bracket_cjk' => array( - '([<>\[\]\{\}\(\)])([' . $cjk . '])', - '$1 $2' - ) - ) - ), - - 'fix_bracket' => array( - '([<\[\{\(]+)(\s*)(.+?)(\s*)([>\]\}\)]+)', - '$1$3$5' - ), - - 'cjk_ans' => array( - '([' . $cjk . '])([A-Za-zΑ-Ωα-ω0-9`@&%\=\$\^\*\-\+\\/|\\\])', - '$1 $2' - ), - - 'ans_cjk' => array( - '([A-Za-zΑ-Ωα-ω0-9`~!%&=;\|\,\.\:\?\$\^\*\-\+\/\\\])([' . $cjk . '])', - '$1 $2' - ) - ); - - foreach ($patterns as $key => $value) { - if ($key === 'bracket') { - $old = $text; - $new = preg_replace('/' . $value[0][0] . '/iu', $value[0][1], $text); - $text = $new; - - if ($old === $new) { - foreach ($value[1] as $val) { - $text = preg_replace('/' . $val[0] . '/iu', $val[1], $text); - } - } - - continue; - } - - $text = preg_replace('/' . $value[0] . '/iu', $value[1], $text); - } - - return $text; -} \ No newline at end of file -- cgit v1.2.3