Skip to content
A simple java-script object which allows you to get the text and string location of many groups within a regular expression.
JavaScript
Branch: master
Clone or download
dlsloan
Latest commit 5d6ef7b Aug 31, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Feb 25, 2014
MultiRegExp.js Update MultiRegExp.js Nov 5, 2014
README.md Poorly documented behaviour update Aug 31, 2015

README.md

MultiRegExp

A simple java-script object which allows you to get the text and string location of many groups within a regular expression.

USAGE

var exp = new MultiRegExp(/([a-z]+)(?:\s|_)*([0-9]+)/i);
exp.exec("test_53"); //will return {0: {index:0, text:'test'}, 1: {index:5, text:'53'}}

Note: -This requires that capture groups are not nested use (?:...) when bracets around unneeded blocks are required. -Repitition of capture groups is not permitted as regular expressions only return one of the matched capture groups in the repetition use ((?:match)+) instead.

You can’t perform that action at this time.