-2

String Examples :

a1-a2.b1-b2-b3.c1-c2

Need to extract fields like :

a1-a2
b1-b2-b3 
c1-c2

group of words with hypen and separated by dot

trincot
  • 211,288
  • 25
  • 175
  • 211

1 Answers1

1

You can use this regex:

 [^\.]*

and match all occurrences with the g modifier.

Regex tester

trincot
  • 211,288
  • 25
  • 175
  • 211