Skip to content

Commit

Permalink
Clarify digit pair matches
Browse files Browse the repository at this point in the history
A reader requested an explanation via email.
  • Loading branch information
shreyasminocha committed May 12, 2020
1 parent 35afe7b commit b574b67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chapters/character-escapes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ The character escape `\d` matches digit characters, from `0` to `9`. It is equiv
<li>3.14159</li>
</Example>

<Note>
While <code>59</code> is also a pair of digits, most engines look for{" "}
<em>non-overlapping</em> matches from left to right by default.
</Note>

`\D` is the negation of `\d` and is equivalent to `[^0-9]`.

<Example regex={/\D/g}>
Expand Down

1 comment on commit b574b67

@vercel
Copy link

@vercel vercel bot commented on b574b67 May 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please # to comment.