mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
improved regex
This commit is contained in:
parent
03f746a650
commit
867c8ed26c
|
@ -75,7 +75,7 @@ final class OneDriveApi
|
||||||
write(url, "\n\n", "Enter the response uri: ");
|
write(url, "\n\n", "Enter the response uri: ");
|
||||||
readln(response);
|
readln(response);
|
||||||
// match the authorization code
|
// match the authorization code
|
||||||
auto c = matchFirst(response, r"(?:code=)([\w\d-]+)");
|
auto c = matchFirst(response, r"(?:(\?|&)code=)([\w\d-]+)");
|
||||||
if (c.empty) {
|
if (c.empty) {
|
||||||
log.log("Invalid uri");
|
log.log("Invalid uri");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue