alphanum string filter?

Hi,

is there a convenient way to filter an arbitrary string for alphanum
chars only?

example input:
" 2!bc/ABC_"

output:
"2bcABC"

I didn't see something like that on the filter pages:

http://jinja.pocoo.org/docs/2.9/templates/#builtin-filters
https://docs.ansible.com/ansible/playbooks_filters.html

thanks,
nusenu

Probably with the regex_replace filter:

foo>regex_replace(‘[^a-zA-Z0-9]’, ‘’)

Matt Martz:

Probably with the regex_replace filter:

foo>regex_replace('[^a-zA-Z0-9]', '')

thanks!