Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试提出一个符合25此字符串中的正则表达式:
25
Always - 25 (Lifetime
-和之间的空间量25可以是可变的,但尾随(Lifetime将始终存在。
-
(Lifetime
我试过这个:preg_match('/\s(.*)\s\(Lifetime',$sString,$aMatch);但它符合它25之前的一切。
preg_match('/\s(.*)\s\(Lifetime',$sString,$aMatch);
尝试以下操作:
preg_match('~\s+(\d+)\s\(Lifetime~', $sString, $aMatch);
它匹配一个或多个空格字符,后跟一个数字,最后是(Lifetime字符串。