/ stream.nieuweinstituut.nl / node_modules / match-at /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]lib/2 years ago -  
[   ]LICENSE8 years ago1.1K 
[TXT]README.md8 years ago766 d768d73 docs [كارل مبارك]
[   ]package.json2 years ago1.6K3e510ca test new git [كارل مبارك]
README.md

match-at Build Status

Introduction

Like String.prototype.match if it only checked the regex at the given index instead of searching the entire string.

matchAt(/world/, 'hello world', 6);  // ['world']
matchAt(/world/, 'hello world', 0);  // null

Almost like 'hello world'.slice(i).match(/^world/) except the resulting match object's .index property corresponds to the original string, and it doesn't actually slice the string. Most engines optimize taking a substring so this probably isn't particularly valuable in practice, but it was an entertaining exercise and could be useful if you reminisce about these semantics.

License

MIT.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80