【发布时间】:2017-03-09 21:09:09
【问题描述】:
这是我想要否定的模式:
[\+\-][0-9\.]+
这些是示例行:
Stephane Robert (+1.5 Sets)
Stephane Robert (-1.5 Sets)
Philipp Kohlschreiber
Philipp Kohlschreiber (-1.5 Sets)
Philipp Kohlschreiber (+1.5 Sets)
Player Names (n)
Another Player-Player
我想去除除数字之外的所有数字,匹配模式,即我只想要正或负浮点数。
+1.5
-1.5
-1.5
+1.5
我正在使用 php 和 preg_replace。
谢谢!
【问题讨论】:
标签: regex preg-replace negate