0

我有这个长字符串值:

"10 12 10/05/2014 p4=34"

我只想得到两位数字(下划线):

"10 12 10/05/2014 p4=34"
 -- --               -- 

所以结果应该是

10 12 34
4

1 回答 1

1

试一试:

(?<![\d/])\d\d(?![\d/])

在哪里:

(?<![\d/])  : negative lookbehind, assumes there're no digits nor slashes before.
\d\d        : 2 digits.
(?![\d/])   : negative lookahead, assumes there're no digits nor slashes after.
于 2015-01-25T10:44:31.293 回答