From f289e9cbfbede432aeb8684203163c716c7e4f36 Mon Sep 17 00:00:00 2001 From: Rodrous <59244346+Rodrous@users.noreply.github.com> Date: Sat, 31 Dec 2022 11:35:58 +0530 Subject: [PATCH 1/2] Update Youtube Video Id Added few Testcases and Updated Regex --- pywhat/Data/regex.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pywhat/Data/regex.json b/pywhat/Data/regex.json index e510203..ae317aa 100644 --- a/pywhat/Data/regex.json +++ b/pywhat/Data/regex.json @@ -2728,7 +2728,7 @@ }, { "Name": "YouTube Video ID", - "Regex": "^((?=.*[A-Z])(?=.*[a-z])[0-9A-Za-z_-]{10}[048AEIMQUYcgkosw]{1})$", + "Regex": "^([a-zA-Z0-9_-]{11})$", "plural_name": false, "Description": null, "Rarity": 0, @@ -2740,9 +2740,15 @@ ], "Examples": { "Valid": [ - "dQw4w9WgXcQ" + "dQw4w9WgXcQ", + "fJ9rUzIMcZQ", + "xjDjIWPwcPU" ], - "Invalid": [] + "Invalid": [ + "randomstring123", + "abcdefghijkL", + "!@#$%^&*()_" + ] } }, { From 8934dda082eb85878361b61a101f8d1dc077b1d2 Mon Sep 17 00:00:00 2001 From: rodro Date: Sun, 1 Jan 2023 12:01:37 +0530 Subject: [PATCH 2/2] Added Test Cases for YouTube Video ID --- pywhat/Data/regex.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pywhat/Data/regex.json b/pywhat/Data/regex.json index ae317aa..507f8c6 100644 --- a/pywhat/Data/regex.json +++ b/pywhat/Data/regex.json @@ -1332,22 +1332,22 @@ } }, { - "Name": "Digital Object Identifier (DOI)", - "Regex": "^((?:https?:\\/\\/(?:(?:www\\.)?doi\\.org\\/)|doi:)?(10\\.[1-9][0-9]{3}[0-9]*\\/\\S+[^;,.\\s]))$", - "plural_name": false, - "Description": null, - "Rarity": 0.7, - "URL": null, - "Tags": [ + "Name": "Digital Object Identifier (DOI)", + "Regex": "^((?:https?:\\/\\/(?:(?:www\\.)?doi\\.org\\/)|doi:)?(10\\.[1-9][0-9]{3}[0-9]*\\/\\S+[^;,.\\s]))$", + "plural_name": false, + "Description": null, + "Rarity": 0.7, + "URL": null, + "Tags": [ "Identifiers", "Media" - ], - "Examples": { - "Valid": [ - "10.1000/182", - "doi:10.1002/0470841559.ch1" - ] - } + ], + "Examples": { + "Valid": [ + "10.1000/182", + "doi:10.1002/0470841559.ch1" + ] + } }, { "Name": "Internet Protocol (IP) Address Version 6", @@ -2728,7 +2728,7 @@ }, { "Name": "YouTube Video ID", - "Regex": "^([a-zA-Z0-9_-]{11})$", + "Regex": "^([0-9A-Za-z_-]{10}[048AEIMQUYcgkosw]{1})$", "plural_name": false, "Description": null, "Rarity": 0, @@ -2787,4 +2787,4 @@ "Invalid": [] } } -] +] \ No newline at end of file