From 4b8bd8a341a7013594f1caf7a2bd5e88a79480e2 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sun, 3 Dec 2023 23:56:15 -0800 Subject: [PATCH] docstrings --- src/ytdl_sub/script/functions/regex_functions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ytdl_sub/script/functions/regex_functions.py b/src/ytdl_sub/script/functions/regex_functions.py index c933a623..7408221c 100644 --- a/src/ytdl_sub/script/functions/regex_functions.py +++ b/src/ytdl_sub/script/functions/regex_functions.py @@ -20,17 +20,26 @@ class RegexFunctions: @staticmethod def regex_match(regex: String, string: String) -> Array: """ - Cast to String. + Checks for a match only at the beginning of the string. If a match exists, returns + the string as the first element of the Array. If there are capture groups, returns each + group as a subsequent element in the Array. """ return _re_output_to_array(re.match(regex.value, string.value)) @staticmethod def regex_search(regex: String, string: String) -> Array: """ - Cast to String. + Checks for a match anywhere in the string. If a match exists, returns + the string as the first element of the Array. If there are capture groups, returns each + group as a subsequent element in the Array. """ return _re_output_to_array(re.search(regex.value, string.value)) @staticmethod def regex_fullmatch(regex: String, string: String) -> Array: + """ + Checks for entire string to be a match. If a match exists, returns + the string as the first element of the Array. If there are capture groups, returns each + group as a subsequent element in the Array. + """ return _re_output_to_array(re.fullmatch(regex.value, string.value))