Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
yoav-lavi committed Mar 8, 2022
1 parent c3a9171 commit f480fd5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment has been minimized.

Copy link
@dcousens

dcousens Mar 8, 2022

Intentional?

This comment has been minimized.

Copy link
@yoav-lavi

yoav-lavi Mar 8, 2022

Author Owner

No, a copy paste issue. Thanks for marking this!

This comment has been minimized.

Copy link
@yoav-lavi

yoav-lavi Mar 8, 2022

Author Owner

Should be fixed now


### Batman Theme

```rust
```rs
16 of "na";

2 of match {
Expand All @@ -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 <word>;

Expand All @@ -66,14 +68,14 @@ some of <word>;

Turns into

```regex
#\w+
```
#(?:\w)+
```

### Introductory Courses

```rust
some of <word>;
```rs
some of <alphabetic>;
<space>;
"1";
2 of <digit>;
Expand All @@ -83,13 +85,13 @@ some of <word>;

Turns into

```regex
\w+ 1\d{2}
```
(?:[a-zA-Z])+ 1(?:\d){2}
```

### Indented Code (2 spaces)

```rust
```rs
some of match {
2 of <space>;
}
Expand All @@ -102,13 +104,13 @@ some of <char>;

Turns into

```regex
```
(?: {2})+.+;
```

### Semantic Versions

```rust
```rs
<start>;

option of "v";
Expand Down Expand Up @@ -136,8 +138,8 @@ capture patch {

Turns into

```regex
^v?(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)$
```
^v?(?<major>(?:\d)+)\.(?<minor>(?:\d)+)\.(?<patch>(?:\d)+)$
```

## Playground
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,13 +37,13 @@ some of <word>;
Turns into

```
#\w+
#(?:\w)+
```

## Introductory Courses

```
some of <alphabet>;
some of <alphabetic>;
<space>;
"1";
2 of <digit>;
Expand All @@ -54,7 +54,7 @@ some of <alphabet>;
Turns into

```
[a-zA-Z]+\s1\d{2}
(?:[a-zA-Z])+ 1(?:\d){2}
```

## Indented Code (2 spaces)
Expand All @@ -64,7 +64,7 @@ some of match {
2 of <space>;
}
some of char;
some of <char>;
";";
// let value = 5;
Expand Down Expand Up @@ -107,5 +107,5 @@ capture patch {
Turns into

```
^v?(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)$
^v?(?<major>(?:\d)+)\.(?<minor>(?:\d)+)\.(?<patch>(?:\d)+)$
```

0 comments on commit f480fd5

Please sign in to comment.