Welcome to WebmasterWorld Guest from 18.104.22.168
"blue items (pack of 12)"
It creates an key in the format:
...you'll see that all punctuation has been replaced by a hyphen. It's this bit that I don't know how to do in a single hit.
Any ideas how I go about this?
This will take any bits of the string that aren't alphanumeric characters and turn them into single spaces, then trim any leading or trailing spaces, then replace the spaces with hyphens.
The reason I didn't go straight to hyphens is because that last parenthesis would become a trailing hyphen.