New to regex and I’m having difficulty putting together a regex argument for this custom function re_replace in python:
{{fieldname|re_replace(pattern, replacement)}}
The pattern uses regex and I’d like to return the following id=0123456 where the fieldname follows the format below:
https://a.website.com/page.php?id=0123456&variable1=abcde123&variable2=abc123de
I’ve managed to replace the id=0123456 but haven’t been able to do the inverse. Thanks in advance.
Could you use
re.searchrather than your own custom function to do this?The syntax would be:
To do the inverse operation you could use
re.sub.