January 2019
Intermediate to advanced
520 pages
14h 32m
English
The USERS_PATH is a new pattern, which we didn't have in the previous example. We'll use it to return a full list of users on the server. This pattern fits only two variants of the path:
The regular expression to handle these cases is quite simple: "^/users/?$". We've already seen all the symbols in this pattern. It expects a string to begin with the ^ symbol and the slash symbol. After that, it expects users with an optional slash at the tail /?. Finally, it expects the end of a string with the $ symbol.
Read now
Unlock full access