-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
  • 317,000
  • 35
  • 244
  • 286

1 Answers1

1

You can use this regex:

 [^\.]*

and match all occurrences with the g modifier.

Regex tester

trincot
  • 317,000
  • 35
  • 244
  • 286