improving regex to accept hash rocket and match the correct groups