@@ -234,13 +234,14 @@ export class UrlMatcher {
234234 // The regular expression is somewhat complicated due to the need to allow curly braces
235235 // inside the regular expression. The placeholder regexp breaks down as follows:
236236 // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)
237- // \{([\w\[\]]+)(?:\:\s* ( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4 ) (search version has - for snake-case
237+ // \{([\w\[\]]+)(?:\: ... ( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($5 ) (search version has - for snake-case
238238 // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either
239- // [^{}\\]+ - anything other than curly braces or backslash
239+ // [^{}\\] - anything other than curly braces or backslash
240240 // \\. - a backslash escape
241- // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms
242- const placeholder = / ( [: * ] ) ( [ \w \[ \] ] + ) | \{ ( [ \w \[ \] ] + ) (?: \: \s * ( (?: [ ^ { } \\ ] + | \\ .| \{ (?: [ ^ { } \\ ] + | \\ .) * \} ) + ) ) ? \} / g;
243- const searchPlaceholder = / ( [: ] ? ) ( [ \w \[ \] . - ] + ) | \{ ( [ \w \[ \] . - ] + ) (?: \: \s * ( (?: [ ^ { } \\ ] + | \\ .| \{ (?: [ ^ { } \\ ] + | \\ .) * \} ) + ) ) ? \} / g;
241+ // \{(?:[^{}\\]|\\.)*\} - a matched set of curly braces containing other atoms
242+ const placeholder = / ( [: * ] ) ( [ \w \[ \] ] + ) | \{ ( [ \w \[ \] ] + ) (?: \: (? = ( \s * ) ) \4( (?: [ ^ { } \\ ] | \\ .| \{ (?: [ ^ { } \\ ] | \\ .) * \} ) + ) ) ? \} / g;
243+ const searchPlaceholder =
244+ / ( [: ] ? ) ( [ \w \[ \] . - ] + ) | \{ ( [ \w \[ \] . - ] + ) (?: \: (? = ( \s * ) ) \4( (?: [ ^ { } \\ ] | \\ .| \{ (?: [ ^ { } \\ ] | \\ .) * \} ) + ) ) ? \} / g;
244245 const patterns : any [ ] [ ] = [ ] ;
245246 let last = 0 ;
246247 let matchArray : RegExpExecArray ;
@@ -256,7 +257,7 @@ export class UrlMatcher {
256257 const matchDetails = ( m : RegExpExecArray , isSearch : boolean ) : MatchDetails => {
257258 // IE[78] returns '' for unmatched groups instead of null
258259 const id : string = m [ 2 ] || m [ 3 ] ;
259- const regexp : string = isSearch ? m [ 4 ] : m [ 4 ] || ( m [ 1 ] === '*' ? '[\\s\\S]*' : null ) ;
260+ const regexp : string = isSearch ? m [ 5 ] : m [ 5 ] || ( m [ 1 ] === '*' ? '[\\s\\S]*' : null ) ;
260261
261262 const makeRegexpType = ( str ) =>
262263 inherit ( paramTypes . type ( isSearch ? 'query' : 'path' ) , {
0 commit comments