Closed whaaaley closed 8 years ago
..otherwise LGTM!
Failing test:
test('regexp', function(t) {
t.deepEqual(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nes } } post'), {
start: 3,
end: 17,
pre: 'pre',
body: 'in{nes }',
post: 'post'
});
});
Useful when you have a repeating or an unknown amount of characters in
a
orb
and don't want them in the result.Example
Solution
Returns