In the code below, the action should replace all words that begin with "the" as a list. But it returns a blank list.
\# Extracts words from input text and outputs it as a list
import re
import editor
import workflow
params = workflow.get_parameters()
sentence = workflow.get_input()
list = []
expression = '^the'
pattern = re.compile(expression)
matches = re.findall(pattern,sentence)
for word in matches:
list.append(word)
workflow.set_output('\n'.join(list))
This code works with other special characters, but this isn't working. Any tips?