<commit_before># parth
[<img alt="build" src="http://img.shields.io/travis/stringparser/parth/master.svg?style=flat-square" align="left"/>](https://travis-ci.org/stringparser/parth/builds)
[<img alt="NPM version" src="http://img.shields.io/npm/v/parth.svg?style=flat-square" align="right"/>](http://www.npmjs.org/package/parth)
<p align="center">
  <a href="#documentation">documentation</a> -
  <a href="#examples">examples</a> -
  <a href="#install">install</a> -
  <a href="#todo">todo</a> -
  <a href="#why">why</a>
</p>

path to regexp madness not only for an url

## usage

```js
var parth = new require('parth')();
```

_set_

```js
parth.set('get /:page(\\w+(?:end))/baby user.:data(\\d+).:drink :when')
{
  /^get \/(\w+(?:end))\/baby user\.(\d+)\.([^u ]+) ([^: ]+)/i
  path: 'get /:page(\\w+(?:end))/baby user.:data(\\d+).:drink :when',
  cus: 2,
  def: 2
}
```
_get_

```js
var extra = { };
parth.get('get /weekend/baby/?query=string#hash user.10.beers now', extra)
{
  /^get \/(\w+(?:end))\/baby user\.(\d+)\.([^u ]+) ([^: ]+)/i
  path: 'get /:page(\\w+(?:end))/baby user.:data(\\d+).:drink :when',
  cus: 2,
  def: 2
}

console.log(extra);
{
  notFound: false,
  path: 'get /weekend/baby user.10.beers now',
  url: '/weekend/baby?query=string#hash',
  depth: 7,
  match: 'get /weekend/baby user.10.beers now',
  params:  {
    _: [ 'page', 'data', 'drink', 'when' ],
    page: 'weekend',
    data: 10,
    drink: 'beers',
    when: 'now'
  }
}
```<commit_msg>sample had the bug of 1.11<commit_after># parth
[<img alt="build" src="http://img.shields.io/travis/stringparser/parth/master.svg?style=flat-square" align="left"/>](https://travis-ci.org/stringparser/parth/builds)
[<img alt="NPM version" src="http://img.shields.io/npm/v/parth.svg?style=flat-square" align="right"/>](http://www.npmjs.org/package/parth)
<p align="center">
  <a href="#documentation">documentation</a> -
  <a href="#examples">examples</a> -
  <a href="#install">install</a> -
  <a href="#todo">todo</a> -
  <a href="#why">why</a>
</p>

path to regexp madness not only for an url

## sample

```js
var parth = new require('parth')();
```

_set_

```js
parth.set('get /:page(\\w+(?:end))/baby user.:data(\\d+).:drink :when')
{
  /^get \/(\w+(?:end))\/baby user\.(\d+)\.([^. ]+) ([^ ]+)/i
  cus: 2,
  def: 2,
  path: 'get /:page(\\w+(?:end))/baby user.:data(\\d+).:drink :when'
}
```
_get_

```js
var extra = { };
parth.get('get /weekend/baby/?query=string#hash user.10.beers now', extra)
{
  /^get \/(\w+(?:end))\/baby user\.(\d+)\.([^. ]+) ([^ ]+)/i
  cus: 2,
  def: 2,
  path: 'get /:page(\\w+(?:end))/baby user.:data(\\d+).:drink :when'
}

console.log(extra);
{
  notFound: false,
  path: 'get /weekend/baby user.10.beers now',
  url: '/weekend/baby?query=string#hash',
  depth: 7,
  match: 'get /weekend/baby user.10.beers now',
  params: {
    _: [ 'page', 'data', 'drink', 'when' ],
    page: 'weekend',
    data: 10,
    drink: 'beers',
    when: 'now'
  }
}
```
{'fraction_non_alphanumeric': 0.2753132407720962, 'fraction_numerical': 0.009820521503555706, 'mean_word_length': 3.6446540880503147, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1133926', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1264, 'n_words': 225}