0

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

mono
  • 1,651
  • 3
  • 13
  • 7

1 Answers1

1

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

Apparantly, Only perl6 and .net regex can extract subgroups

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

Community
  • 1
  • 1
YOU
  • 120,166
  • 34
  • 186
  • 219