crossroads.js icon indicating copy to clipboard operation
crossroads.js copied to clipboard

":" creates a wrong regexp

Open totty90 opened this issue 10 years ago • 3 comments

For the route "'xy:{x},{y}'" creates: "/^/?xy:/([^/?]+),([^/?]+)/?$/i" instead of "/^/?xy:([^/?]+),([^/?]+)/?$/i"

Test here: http://www.regexr.com/ the string "xy:34234,-2342"

totty90 avatar Jun 28 '14 11:06 totty90

Or maybe the ":" is used for the variables. But please let me use it anyway, even escaping it somehow.

totty90 avatar Jun 28 '14 11:06 totty90

I made the wrong assumption that : was always the end of an optional argument and always going to need / in between 2 arguments.

millermedeiros avatar Jun 29 '14 18:06 millermedeiros

see: https://github.com/millermedeiros/crossroads.js/blob/9e6e24c7c42b85c5e7143c8c881464fa8d1d64d1/dev/src/pattern_lexer.js#L28-L34

millermedeiros avatar Jun 29 '14 18:06 millermedeiros