-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
  • 263,463
  • 30
  • 215
  • 251

1 Answers1

1

You can use this regex:

 [^\.]*

and match all occurrences with the g modifier.

Regex tester

trincot
  • 263,463
  • 30
  • 215
  • 251