-4

I have a String as vsc-nigulp-25.00.00-200.tar , I have to get two set of outputs as vsc-nigulp and 25.00.00-200 from the given string. What Regex conditions would be giving these two set of outputs?

1 Answers1

1

How about:

(^[a-zA-Z-]*)(\d{2}.\d{2}.\d{2}-\d{3})
  • Beginning of text, any number of letters or dashes
  • Followed by your pattern of numbers and dashes

See: https://regex101.com/r/0yjz0Z/1

tk78
  • 937
  • 7
  • 14