Need private packages and team management tools?Check out npm Teams »

match-string

1.0.3 • Public • Published

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!"

Install

npm i match-string

DownloadsWeekly Downloads

76

Version

1.0.3

License

MIT

Last publish

Collaborators

  • avatar