<commit_before>If you know the format of an input string, you can use that to parse a moment.

```javascript
moment("12-25-1995", "MM-DD-YYYY");
```

The parser ignores non-alphanumeric characters, so both of the following will return the same thing.

```javascript
moment("12-25-1995", "MM-DD-YYYY");
moment("12\25\1995", "MM-DD-YYYY");
```

The parsing tokens are similar to the formatting tokens used in `moment#format`.

<table class="table table-striped table-bordered">
  <tbody>
    <tr>
      <th>Input</th>
      <th>Output</th>
    </tr>
    <tr>
      <td>M, MM</td>
      <td>Month Number (1 - 12)</td>
    </tr>
    <tr>
      <td>MMM, MMMM</td>
      <td>Month Name (In currently language set by `moment.lang()`)</td>
    </tr>
    <tr>
      <td>D, DD</td>
      <td>Day of month</td>
    </tr>
    <tr>
      <td>DDD, DDDD</td>
      <td>Day of year</td>
    </tr>
    <tr>
      <td>d, dd, ddd, dddd</td>
      <td>Day of week (NOTE: these formats only make sense when combined with "ww")
    </tr>
    <tr>
      <td>e</td>
      <td>Day of week (locale) (NOTE: these formats only make sense when combined with "ww")
    </tr>
    <tr>
      <td>E</td>
      <td>Day of week (ISO) (NOTE: this format only make sense when combined with "WW")
    </tr><commit_msg>Add docs for ordinal parsing<commit_after>If you know the format of an input string, you can use that to parse a moment.

```javascript
moment("12-25-1995", "MM-DD-YYYY");
```

The parser ignores non-alphanumeric characters, so both of the following will return the same thing.

```javascript
moment("12-25-1995", "MM-DD-YYYY");
moment("12\25\1995", "MM-DD-YYYY");
```

The parsing tokens are similar to the formatting tokens used in `moment#format`.

<table class="table table-striped table-bordered">
  <tbody>
    <tr>
      <th>Input</th>
      <th>Output</th>
    </tr>
    <tr>
      <td>M, MM</td>
      <td>Month Number (1 - 12)</td>
    </tr>
    <tr>
      <td>MMM, MMMM</td>
      <td>Month Name (In currently language set by `moment.lang()`)</td>
    </tr>
    <tr>
      <td>D, DD</td>
      <td>Day of month</td>
    </tr>
    <tr>
      <td>Do</td>
      <td>Ordinal day of month (from `2.6.0`)</td>
    </tr>
    <tr>
      <td>DDD, DDDD</td>
      <td>Day of year</td>
    </tr>
    <tr>
      <td>d, dd, ddd, dddd</td>
      <td>Day of week (NOTE: these formats only make sense when combined with "ww")
    </tr>
    <tr>
      <td>e</td>
      <td>Day of week (locale) (NOTE: these formats only make sense when combined with "ww")
    </tr>
    <tr>
      <td>E</td>
      <td>Day of week (ISO) (NOTE: this format only make sense when combined with "WW")
    </tr>
{'fraction_non_alphanumeric': 0.17010889973713855, 'fraction_numerical': 0.021404431092752536, 'mean_word_length': 2.528476821192053, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, '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': '3941839', 'n_tokens_mistral': 1040, 'n_tokens_neox': 976, 'n_words': 308}