0
0
mirror of https://github.com/semver/semver.git synced 2025-08-22 13:58:33 +00:00

semver.md: add mermaid diagram

This commit is contained in:
Lee Katz 2024-04-23 16:56:51 -04:00 committed by GitHub
parent 38a25311c9
commit 0747c7fa99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -357,6 +357,75 @@ See: <https://regex101.com/r/vkijKf/1/>
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
```
Regex diagram
```mermaid
flowchart TB
START["Start of Line"]
subgraph "MAJOR"
direction LR;
MAJORSTART{{"Choose One"}}
ZERO1["'0'"]
ONETONINE1["'1'-'9'"]
DIGIT1["digit"]
MAJOREND{{"END major"}}
end
DOT1["."]
subgraph "MINOR"
direction LR;
MINORSTART{{"Choose One"}}
ZERO2["'0'"]
ONETONINE2["'1'-'9'"]
DIGIT2["digit"]
MINOREND{{"END minor"}}
end
DOT2["."]
subgraph "PATCH"
direction LR;
PATCHSTART{{"Choose One"}}
ZERO3["'0'"]
ONETONINE3["'1'-'9'"]
DIGIT3["digit"]
PATCHEND{{"END patch"}}
end
DASH3["-"]
START --> MAJOR
ONETONINE1 --> DIGIT1
MAJORSTART --> ONETONINE1
MAJORSTART --> ZERO1
DIGIT1 --> DIGIT1
DIGIT1 --> MAJOREND
ZERO1 --> MAJOREND
ONETONINE1 --> MAJOREND
MAJOR --> DOT1
DOT1 --> MINOR
MINORSTART --> ZERO2
MINORSTART --> ONETONINE2
ONETONINE2 --> DIGIT2
ZERO2 --> MINOREND
DIGIT2 --> MINOREND
DIGIT2 --> DIGIT2
ONETONINE2 --> MINOREND
MINOR --> DOT2
DOT2 --> PATCH
PATCHSTART --> ZERO3
PATCHSTART --> ONETONINE3
ONETONINE3 --> DIGIT3
ZERO3 --> PATCHEND
DIGIT3 --> PATCHEND
DIGIT3 --> DIGIT3
ONETONINE3 --> PATCHEND
PATCH --> DASH3
```
About
-----