1.0.3 • Published 6 years ago

match-string v1.0.3

Weekly downloads
119
License
MIT
Repository
github
Last release
6 years ago

match-string

match-string is a javascript function who return a regexp for match a string with all of his accents possible

Installation

you install it with npm :

npm i match-string

Usage

You can include it easly :

ES6

import m from "match-string";

ES5

var m = require("match-string");

Syntaxe

m("test"); // return /t[eèéêë][sß]t/gi
m("test", "i"); // return /t[eèéêë][sß]t/i

var exp = m("test");
const text = "this is a test Test TEST tést tèst";

text.replace(exp, "!$&!"); // retrun "this is a !test! !Test! !TEST! !tést! !tèst!"