Skip to content

Commit d6c3658

Browse files
committed
Update express 4 compatibility guide
1 parent c302644 commit d6c3658

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Readme.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Previous versions of Path-to-RegExp used these for RegExp features. This version
184184

185185
### Missing parameter name
186186

187-
Parameter names, the part after `:` or `*`, must be a valid JavaScript identifier. For example, it cannot start with a number or contain a dash. If you want a parameter name that uses these characters you can wrap the name in quotes, e.g. `:"my-name"`.
187+
Parameter names must be provided after `:` or `*`, and they must be a valid JavaScript identifier. If you want an parameter name that isn't a JavaScript identifier, such as starting with a number, you can wrap the name in quotes like `:"my-name"`.
188188

189189
### Unterminated quote
190190

@@ -194,10 +194,11 @@ Parameter names can be wrapped in double quote characters, and this error means
194194

195195
Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways:
196196

197-
- Regexp characters can no longer be provided.
197+
- The wildcard `*` must have a name, matching the behavior of parameters `:`.
198198
- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`.
199-
- Some characters have new meaning or have been reserved (`{}?*+@!;`).
200-
- The parameter name now supports all JavaScript identifier characters, previously it was only `[a-z0-9]`.
199+
- Regexp characters are not supported.
200+
- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`).
201+
- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`.
201202

202203
## License
203204

0 commit comments

Comments
 (0)