<commit_before># kld-regex

A simple regular expression engine (and lexer) for ASCII text.

## Compile Regex

```
let Regex = require('kld-regex').Regex;
let runner = Regex.compile("(abc)+");
```

## Get first match

```
var source = "abcdefabc";<commit_msg>Add TOC<commit_after># kld-regex

A simple regular expression engine (and lexer) for ASCII text.

- Regular Expressions
    - [Compile Regex](#compile-regex)
    - [Get first match](#get-first-match)
    - [Get all matches](#get-all-matches)
    - [Supported operators](#supported-operators)
- Lexers
    - [Define a list of token types](#define-a-list-of-token-types)
    - [Build Lexer](#build-lexer)
    - [Match against source](#match-against-source)

## Compile Regex

```
let Regex = require('kld-regex').Regex;
let runner = Regex.compile("(abc)+");
```

## Get first match

```
var source = "abcdefabc";
{'fraction_non_alphanumeric': 0.16589861751152074, 'fraction_numerical': 0.0, 'mean_word_length': 4.023121387283237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '994889', 'n_tokens_mistral': 309, 'n_tokens_neox': 286, 'n_words': 76}