From f480fd588bd9ba6b88a72eb5256bdc19360e3d85 Mon Sep 17 00:00:00 2001 From: Yoav Lavi Date: Tue, 8 Mar 2022 19:13:54 +0100 Subject: [PATCH] update examples --- README.md | 30 ++++++++++++++++-------------- docs/docs/examples.md | 12 ++++++------ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 3ea69e0d..e1a46cb1 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,11 @@ The current goal is supporting the JavaScript implementation of regular expressi Note: these are for the currently supported syntax and may change +Note: these are for the currently supported syntax and may change + ### Batman Theme -```rust +```rs 16 of "na"; 2 of match { @@ -51,13 +53,13 @@ Note: these are for the currently supported syntax and may change Turns into -```regex +``` (?:na){16}(?: batman){2} ``` ### Twitter Hashtag -```rust +```rs "#"; some of ; @@ -66,14 +68,14 @@ some of ; Turns into -```regex -#\w+ +``` +#(?:\w)+ ``` ### Introductory Courses -```rust -some of ; +```rs +some of ; ; "1"; 2 of ; @@ -83,13 +85,13 @@ some of ; Turns into -```regex -\w+ 1\d{2} +``` +(?:[a-zA-Z])+ 1(?:\d){2} ``` ### Indented Code (2 spaces) -```rust +```rs some of match { 2 of ; } @@ -102,13 +104,13 @@ some of ; Turns into -```regex +``` (?: {2})+.+; ``` ### Semantic Versions -```rust +```rs ; option of "v"; @@ -136,8 +138,8 @@ capture patch { Turns into -```regex -^v?(?\d+)\.(?\d+)\.(?\d+)$ +``` +^v?(?(?:\d)+)\.(?(?:\d)+)\.(?(?:\d)+)$ ``` ## Playground diff --git a/docs/docs/examples.md b/docs/docs/examples.md index f744c96e..bce337ea 100644 --- a/docs/docs/examples.md +++ b/docs/docs/examples.md @@ -22,7 +22,7 @@ Note: these are for the currently supported syntax and may change Turns into ``` -(?:na){16}(?:\sbatman){2} +(?:na){16}(?: batman){2} ``` ## Twitter Hashtag @@ -37,13 +37,13 @@ some of ; Turns into ``` -#\w+ +#(?:\w)+ ``` ## Introductory Courses ``` -some of ; +some of ; ; "1"; 2 of ; @@ -54,7 +54,7 @@ some of ; Turns into ``` -[a-zA-Z]+\s1\d{2} +(?:[a-zA-Z])+ 1(?:\d){2} ``` ## Indented Code (2 spaces) @@ -64,7 +64,7 @@ some of match { 2 of ; } -some of char; +some of ; ";"; // let value = 5; @@ -107,5 +107,5 @@ capture patch { Turns into ``` -^v?(?\d+)\.(?\d+)\.(?\d+)$ +^v?(?(?:\d)+)\.(?(?:\d)+)\.(?(?:\d)+)$ ```