(pattern, callback)
| 1 | const 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 | |
| 11 | const explicit = (matcher) => (text, position) => { |
| 12 | const previous = text[position - 1]; |