Reputation: 2013
I need a Power Automate expression to extract a substring from a string, based on the regex
AA-BBB-\d{1,6}
but apparently Power Automate doesn't offer a regex match/extract function via expressions. Is there an easy way, possibly a short custom expression?
Upvotes: 1
Views: 4613
Reputation: 61
You can use a python script to add in the regex.
Step to add : Run Python Script
E.g. :
import re
p = re.compile("AA-BBB-\d{1,6}")
value="""%AttributeValue%"""
result = p.search(value).group()
print (result)
Advanced : Module Folder Path : You have to link to the re library in your computer.
Hope it helps.
Upvotes: 0
Reputation: 231
You can use RegEx in Power Automate without using any custom connector using
Excel Run script action and create RegEx function in any Excel using office script typescript language. It's simple straightforward not much complex to do.
Full detailed implementation can be checked on this link.
[https://www.youtube.com/watch?v=S22719J_yXw]
Upvotes: 0