MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / regexp

Function regexp

packages/ast/parse/combinators.js:1–9  ·  view source on GitHub ↗
(pattern, callback)

Source from the content-addressed store, hash-verified

1const regexp = (pattern, callback) => (text, position) => {
2 const match = text.substring(position).match(pattern);
3
4 if (!match) {
5 return null;
6 }
7
8 return callback(match, text, position);
9};
10
11const explicit = (matcher) => (text, position) => {
12 const previous = text[position - 1];

Callers 3

index.jsFile · 0.85
index.jsFile · 0.85
index.jsFile · 0.85

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected