regex-charcode-htmlentities
v0.0.4
Published
Inspired by diacritics-regex and htmlentities, create a regex with the term indicated by changing each character for a regex expression with variaves of charCode and Html Entities
Downloads
4
Maintainers
Readme
#Regex CharCode HtmlEntities Generator
Inspired by diacritics-regex and htmlentities, create a regex with the term indicated by changing each character for a regex expression with variaves of charCode and Html Entities
var regex = require('regex-charcode-htmlentities')
console.log(regex('maçã'))
/*
/m([AaÀàÁáÂâÃãÄä]|AaÀ|à|Á|á|Â|â|Ã|ã|Ä|ä)
([CcÇç]|CcÇ|ç)([AaÀàÁáÂâÃãÄä]|AaÀ|à|Á|á|Â|â|&Atild
e;|ã|Ä|ä)/i
*/
console.log(regex('maçã','g'))
/*
/m([AaÀàÁáÂâÃãÄä]|AaÀ|à|Á|á|Â|â|Ã|ã|Ä|ä)
([CcÇç]|CcÇ|ç)([AaÀàÁáÂâÃãÄä]|AaÀ|à|Á|á|Â|â|&Atild
e;|ã|Ä|ä)/g
*/
console.log(regex('maçã', false))
/*
m([AaÀàÁáÂâÃãÄä]|AaÀ|à|Á|á|Â|â|Ã|ã|Ä|ä)
([CcÇç]|CcÇ|ç)([AaÀàÁáÂâÃãÄä]|AaÀ|à|Á|á|Â|â|&Atild
e;|ã|Ä|ä)
*/