I\'m relatively new to Python and it\'s libraries and I was wondering how I might create a string array with a preset size. It\'s easy in java but I was wondering how I might do
def _remove_regex(input_text, regex_pattern):
findregs = re.finditer(regex_pattern, input_text)
for i in findregs:
input_text = re.sub(i.group().strip(), '', input_text)
return input_text
regex_pattern = r"\buntil\b|\bcan\b|\bboat\b"
_remove_regex("row and row and row your boat until you can row no more", regex_pattern)
\w
means that it matches word characters, a|b
means match either a
or b
, \b
represents a word boundary