From 867c8ed26cd98f86f0bd0cc40a4369f13ac05a54 Mon Sep 17 00:00:00 2001 From: skilion Date: Fri, 19 Jan 2018 18:56:14 +0100 Subject: [PATCH] improved regex --- src/onedrive.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onedrive.d b/src/onedrive.d index c9888ce5..38888a83 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -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;