{"repo":"pocesar/js-diacritic-regex","free":true,"listed":false,"github":"https://github.com/pocesar/js-diacritic-regex","clone":"git clone https://github.com/pocesar/js-diacritic-regex.git","description":"Creates the inverse of transliterated string to a regex. What? Basically, diacritic insensitiveness","language":"TypeScript","stars":28,"topics":["regex","database","diacritics","transliteration","transliterate","regexp","regexp-search","regex-match","accent","accents"],"license":"MIT","category":"databases-storage","readme_excerpt":"Diacritic regex Creates the inverse of transliterated string to a regex. What? Basically, a regex that is diacritic insensitive Why? Sometimes the user will search for blasé , but your database is dumb and doesn't understand collations and diacritic insensitiveness, but it can compare stuff using regex, so there ya go. How? Suppose you have the word résumé but written improperly in the database as resume . The user is clever, and types it correctly into the search box. Gets nothing. How to search for all the weird cases people mistype stuff when comes to accents? If you want to change the mappings for all instances: Caveats Be aware of RegExp.prototype.exec with g flag being stateful The i flag is appended to the RegExp flags if you don't pass any flags to toRegex Compatibility Work in node and the browser, but needs polyfills for Array.reduce , Array.map and Object.keys depending on how old your target browser is License MIT","default_branch":null,"files":null,"tree":[],"storefront":"/r/pocesar","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pocesar/js-diacritic-regex/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}