How to match URLs with a colon in their name #274
-
Colon ( How would I write a route spec for such URLs with
By now I assume that this class of URLs cannot be handled with NOTE: A colon ( "Common" characters that are NOT allowed in URL pathnames (according to my reading of the RFC) are Am I overthinking this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use backslash to escape the colon. The backslash needs to be in the string, ans since Javascript itself treats backslash as a special characher, to get a backslash in a string requires escaping it, like so: |
Beta Was this translation helpful? Give feedback.
You can use backslash to escape the colon. The backslash needs to be in the string, ans since Javascript itself treats backslash as a special characher, to get a backslash in a string requires escaping it, like so:
'\\'
. This means a string of your path, witten as a Javascript literal, would need to be'/wiki/Category\\::category'