<commit_before>need better data structure for routes. at least we need to make the route
object modifiable before it's called for isMatch() to support micro-framework
idioms. probably reduce the constructor size and replace with setter methods.
lock it after matched?

split the route adding/attaching from the matching?

get rid of $attach from the Router constructor? still want to be able to
attach route defs from packages/modules/etc, and not just have them call the
router directly.

hierarchical routing, or route grouping? can we do this by attaching a second
router object?

for the main router object, define defaults? that would go along with "second
router object" being attached.

change 'format' examples to '(\.[^/]+)?'

make token regex [a-z][a-zA-Z0-9_] and make it work more properly with
optional params


* * *

making resource routes:

```php
<?php
    $router->set('api.v1.blog', '/api/v1/blog', array(
        'resource' => true,
    ));
?>
```

Is the equivalent of:

```php
<?php
    // browse/index/home/etc
    $router->set('api.v1.blog', '/api/v1/blog', array(
        'require' => array(
            'REQUEST_METHOD' => 'GET',
        ),
        'default' => array(<commit_msg>update todo<commit_after>need better data structure for routes. at least we need to make the route
object modifiable before it's called for isMatch() to support micro-framework
idioms. probably reduce the constructor size and replace with setter methods.
lock it after matched?

split the route adding/attaching from the matching?

get rid of $attach from the Router constructor? still want to be able to
attach route defs from packages/modules/etc, and not just have them call the
router directly.

hierarchical routing, or route grouping? can we do this by attaching a second
router object?

for the main router object, define defaults? that would go along with "second
router object" being attached.

make token regex [a-z][a-zA-Z0-9_] and make it work more properly with
optional params


* * *

making resource routes:

```php
<?php
    $router->set('api.v1.blog', '/api/v1/blog', array(
        'resource' => true,
    ));
?>
```

Is the equivalent of:

```php
<?php
    // browse/index/home/etc
    $router->set('api.v1.blog', '/api/v1/blog', array(
        'require' => array(
            'REQUEST_METHOD' => 'GET',
        ),
        'default' => array(
{'fraction_non_alphanumeric': 0.10641891891891891, 'fraction_numerical': 0.005067567567567568, 'mean_word_length': 3.512380952380952, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '838037', 'n_tokens_mistral': 700, 'n_tokens_neox': 679, 'n_words': 294}