Hi im trying to create a regex for the following expression
I need matching groups on all the integers
- Valid
- integer-integer
- integer-integer/integer
- Invalid
- integer-integer/
So the first part would be like
^(\d+)-(\d+)
which matches 1-50
With these matching groups
- 1st group: 1
- 2nd group: 50
what do i need to add to the second part to make
/integer
optional but / should not be in the 3rd matching group and an integer is supplied