Regular Expressions 101

Community Library

Community Library Entry

0

Regular ExpressionOpen Workspace

/
^(?!graphql|dashboard|telescope)[\/\w-]*
/
gm

Description
Created·2022-08-10 14:19
Type·Match
Flavor·PCRE2 (PHP)

When creating a SPA we could capture all routes except some.

Needed this for Laravel

Route::get('/{any?}', function () { return 'Not captured'; })->where('any', '^(?!graphql|dashboard|telescope)[/\w\·-]*');

Submitted by aldo-f
Open Workspace