1 year ago

Regex for one of the route parameters to not match an array of strings

Posted 1 year ago by if


I'm trying to make a dynamic subdomains routing, when searching on google I've came across this Regex :

    Route::pattern('sub', '^(?!.*(cdn|www)).*$');

but unfortunatly it does match also words like 'xcdn' and 'hiwww', do you have any suggestions?

Thank you in advance.

Please sign in or create an account to participate in this conversation.