Regular Expressions 101

Community Patterns

Replace :parameters on route navigation

1

Regular Expression
PCRE (PHP <7.3)

/
(?=:)(.*?)(?=\/|$)
/
gm

Description

Lets modify a route dinamically from any word that starts with ':' until the next slash

Submitted by anonymous - 5 years ago