Can anyone suggest how I edit this routes to allow the last parameter to accept both _ and – characters.
$route['hotel/pages/(:any)/(\w+.html$)'] = 'hotel/page/redirect/$1/$2';
So in this instance the \w+html$ would need to be modified to accept both _ and - characters – can anyone suggest what I should do next, I’ve tried adding _- after the w+ but this doesn’t work
You need a character class
[\w-]is matching for one character from inside the brackets. I don’t added_because its already included in\w. Additionally I escaped the dot, its a special character and would match any character.