Hi,
I am attempting to use Code by Zapier, Python, to extract a specific set of numbers in sequence from a random string of text. The set of numbers will start with four leading zeros. The Python code I am using is adapted from the following which I created in a Python compiler;
str = "body of SMS 5PM 9PM 2AM 4 8 2 00001124"
#search using regex
x = re.findall('0000+[0-9]+[0-9]',str)
print('%.8s' %x[0])
The output from the above is 00001124, which is perfect.
In Code by Zapier Set up Action, I have the following:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/3cc835ad-c729-4fb7-a8f0-c28794268325.png)
The error I am receiving is this:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/7f166207-1bef-4640-88a0-de76f9b863cf.png)
The objective is to search the entire string and only output the eight digits with four leading zeros. Thanks in advance.
Best answer by Troy Tessalone
View original