Skip to content

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

Notifications You must be signed in to change notification settings

codephi/node-regex-charcode-htmlentities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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;|ã|Ä|ä)
*/

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published