Regex in handlebar to get everything after the first whitespace doesn't work during flow execution
For a name like "John B Doe", I need first name to be "John" and last name to be "B Doe".
While testing the handlebars statement in Dev playground the below statements work correctly.
{{regexMatch BuyerName "([^\s]+)"}} --> firstname
{{regexMatch BuyerName "(?<=\s).*"}}-->lastname
But when implemented in mapping and when flow is run, it throws invalid_handle_bar_expression
"Could not compile handle bar \"{{regexMatch BuyerName \"(?<=\\s).*\"}}\" because \"Invalid quantifier ?\" .Please correct and retry"
Why is it not able to compile when it worked in playground. Please help
3
Comments
Hi Ugene Jude -
I created a Support ticket for this issue. You should receive an email with the information.
Thanks!
Kate
Thank you Kate
Hi Ugene -
I hope you're doing well.
Did you happen to come across a solution to this one?
- Merik
Here's where I landed:
Explanation:
Merik Ducker Thank you for this workaround and explanation!! I ran into the same issue, and was able to get around it with your method. You just saved me a ton of time.
For anyone else wondering, the reason that this error occurs is because Javascript does not support lookahead / lookbehind, and "?" is involved in the process. You will need to find a different way to structure your formula that avoids lookaheads/lookbehinds.
Please sign in to leave a comment.