I am creating a field that will serve as a slug. I already made the regex the way I want it to be, but I still need to change all letters with ~ and ´ ( ã í e.g) for letters without an accent.
My regex:
slug
.toLocaleLowerCase()
.replace(/[^a-z0-9]/g, '-')
.replace(/(^-+)|(-+$)/g, '')