Skip to content

Commit

Permalink
Fix escape markdown table
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Apr 17, 2017
1 parent 1e78dac commit c604388
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/regexp/fail-faster.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Slow `RegExp` processing is usually caused by slow failure rather than slow matc

Reduce the use of `|` using character classes and optional components, or by pushing the alternation further back into the `RegExp` (allowing some match attemps to fail before reaching the alternation):

| Instead of | Use |
|---------------|----------------|
| `cat|bat` | `[cb]at` |
| `red|read` | `rea?d` |
| `red|raw` | `r(?:ed|aw)` |
| `(.\|\r\|\n)` | `[\s\S]` |
| Instead of | Use |
|-----------------------|-----------------|
| cat|bat | [cb]at |
| red|read | rea?d |
| red|raw | r(?:ed|aw) |
| (.\|\r\|\n) | [\s\S] |

All people known `RegExp` are difficult to write. A good approach for write the right `RegExp` is automate the process.

Expand Down

0 comments on commit c604388

Please sign in to comment.