Skip to content

Commit

Permalink
Add cases for advanced example "Meta"
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasminocha committed May 1, 2020
1 parent 180f871 commit a88e6cb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions chapters/advanced-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ title: Advanced Examples
## Meta

<Example regex={/<Example source="(.*?)" flags="(.*?)">/gm}>
<li>.</li>
<li>&lt;Example source="\s+$" flags="gm"&gt;</li>
<li>{'<Example source="p[aeiou]t" flags="g">'}</li>
<li>{'<Example source="s+$" flags="gm">'}</li>
<li>{`<Example source="(['"])(?:(?!\\1).)*\\1" flags="g">`}</li>
<li>{"<Example source='s+$' flags='gm'>"}</li>
<li>{"</Example>"}</li>
</Example>

**Replace**: `<Example regex={/$1/$2}>`

## Floating point numbers

- optional sign
Expand All @@ -68,7 +73,7 @@ title: Advanced Examples
<li>.</li>
</Example>

The positive lookahead `(?=\.\d|\d)` ensures that `.` does not match.
The positive lookahead `(?=\.\d|\d)` ensures that the regex does not match `.`.

## HSL colours

Expand Down

0 comments on commit a88e6cb

Please # to comment.