^([a-z-]+-on-sale(?:,[a-z-]+-on-sale){0,})[\/]$
This regex is used in a htaccess file and matches a pattern such as this one:
tools-on-sale,candy-on-sale,food-on-sale/
I've been wondering whether it's possible or not for me to capture a subsection of a repeated capture group. I want to match the same pattern, but I want to omit the "-on-sale" part in the repeated capture group. I know I can already do this for the first part of the regex:
^(([a-z-]+)-on-sale(?:,[a-z-]+-on-sale){0,})[\/]$
That way I have "tools" isolated in its own capture group, but I can't seem to do with the same with the second part. Is this even doable with a regex?