Skip to content

Commit

Permalink
Improve readme formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Aug 20, 2023
1 parent cbc9361 commit d947b72
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Be explicit and extract common pieces
<details>
<summary>Click to see examples</summary>

--------------------------------

Compare a readable-regexp expression:

```js
Expand Down Expand Up @@ -97,6 +99,8 @@ const email =
/^([^<>()[\]\\.,;:@"\s]+(?:\.[^<>()[\]\\.,;:@"\s]+)*|".+")@(\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]|(?:[a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,})$/;
```

--------------------------------

</details>

### 📐 Flexible and Concise
Expand All @@ -106,6 +110,8 @@ Multiple shorthands and syntax options
<details>
<summary>Click to see examples</summary>

--------------------------------

Without all the shorthands, an expression looks like this:

```js
Expand Down Expand Up @@ -156,6 +162,8 @@ const regExp = exactly`[`

As you can see, most of the distracting brackets are gone, and you are left with a clean and concise expression.

--------------------------------

</details>

### 🛟 Safe
Expand All @@ -165,6 +173,8 @@ Type check, auto-complete, and runtime safeguards
<details>
<summary>Click to see examples</summary>

--------------------------------

Some errors can be avoided just by writing in readable-regexp:

```js
Expand Down Expand Up @@ -206,6 +216,8 @@ const result2 = capture`foo`.ref(2).toRegExp().test('foofoo');
// Error: The following backreferences are not defined: 2
```

--------------------------------

</details>

## Installation
Expand Down Expand Up @@ -237,6 +249,6 @@ const { oneOrMore, exactly } = readableRegExp;
## Quick Start / Documentation

| [**Quick Start**](https://hlysine.gitbook.io/readable-regexp/getting-started/installation) |
| ------------------------------------------------------------------------------------------ |
|:------------------------------------------------------------------------------------------:|
| [**Documentation**](https://hlysine.gitbook.io/readable-regexp/) |
| [**TypeDoc**](https://hlysine.github.io/readable-regexp/) |

0 comments on commit d947b72

Please sign in to comment.