docstrings

This commit is contained in:
Jesse Bannon 2023-12-03 23:56:15 -08:00
parent e941a462c1
commit 4b8bd8a341

View file

@ -20,17 +20,26 @@ class RegexFunctions:
@staticmethod @staticmethod
def regex_match(regex: String, string: String) -> Array: 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)) return _re_output_to_array(re.match(regex.value, string.value))
@staticmethod @staticmethod
def regex_search(regex: String, string: String) -> Array: 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)) return _re_output_to_array(re.search(regex.value, string.value))
@staticmethod @staticmethod
def regex_fullmatch(regex: String, string: String) -> Array: 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)) return _re_output_to_array(re.fullmatch(regex.value, string.value))