Preg.php
483 字节
<?php
namespace Lackoxygen\TiktokShop\Util;
class Preg
{
/**
* @param string $docs
* @return array|mixed
*/
public static function annotation(string $docs)
{
preg_match_all('/@.*?/U', $docs, $matches);
return $matches[0] ?? [];
}
/**
* @param $string
* @return array|string|string[]|null
*/
public static function mergeSpaces($string)
{
return preg_replace("/\s(?=\s)/", "\\1", $string);
}
}