tags:

views:

56

answers:

1

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 ..."

+1  A: 

You need to do like (\w+)\.(\w+)\.(\w+)\.(\w+)

Apparantly, Only perl6 and .net regex can extract subgroups

Note: \w =>[a-zA-Z0-9_]

S.Mark
Don't need both \d and \w.
Amber
Thank you @Dav .
S.Mark
thanks, just only perl6?
mono