mostcommon

1.0.1 • Public • Published

Most Common

Given an array of regex patterns and a block of text, find the input pattern with the most matches in the text

Usage

var inputs = [
  'a1',
  'a2',
  'a3',
  'a4'
];

var text = 'Lorem a1 ipsum a1 dolor a1 sit a2 amet, a2 consectetur a3 adipiscing'

// max should be 'a1'
var max = mostcommon(inputs, text);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 0.0.0
    2

Package Sidebar

Install

npm i mostcommon

Weekly Downloads

4

Version

1.0.1

License

BSD

Last publish

Collaborators

  • clewfirst