Im not sure how I can achieve this match expression. Currently I am using,
([A-Za-z0-9-]+)
…which matches letters and numbers. I would also like to match on dashes and underscores in the same expression. Anyone know how?
I would like to be able to match product_name and product-name
Just escape the dashes to prevent them from being interpreted (I don’t think underscore needs escaping, but it can’t hurt). You don’t say which regex you are using.