a ip or other string, like "11.22.33.44" or "aa.bb.cc.dd". basically, I think it is very easy, (([\d\w]+)+\.)+[\d\w]+
but the problem is which group these submatches are in. not like ip, some string is consist of lots of words+separate
in pcre, I don't know how to 开发者_开发百科extract it all words -- "aa bb cc dd ..."
You need to do like (\w+)\.(\w+)\.(\w+)\.(\w+)
Apparantly, Only perl6 and .net regex can extract subgroups
Note: \w
=>[a-zA-Z0-9_]
精彩评论