How to split text before bracket in html

input :- 70-71-72(10)
20-21-22(5)

output:- [77,71,72] =>10
[20,21,22]=>5

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile: