improved regex

This commit is contained in:
skilion 2018-01-19 18:56:14 +01:00
parent 03f746a650
commit 867c8ed26c

View file

@ -75,7 +75,7 @@ final class OneDriveApi
write(url, "\n\n", "Enter the response uri: ");
readln(response);
// match the authorization code
auto c = matchFirst(response, r"(?:code=)([\w\d-]+)");
auto c = matchFirst(response, r"(?:(\?|&)code=)([\w\d-]+)");
if (c.empty) {
log.log("Invalid uri");
return false;