@v0idd0/regexlab 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -5
- package/package.json +17 -8
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# regexlab
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@v0idd0/regexlab)
|
|
4
|
+
[](https://www.npmjs.com/package/@v0idd0/regexlab)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](package.json)
|
|
7
|
+
|
|
3
8
|
Explain regex patterns in plain english. Read the manual.
|
|
4
9
|
|
|
5
10
|
```
|
|
@@ -11,10 +16,14 @@ pattern: \d{3}-\d{4}
|
|
|
11
16
|
\d{4} → a digit (0–9) exactly 4 times
|
|
12
17
|
```
|
|
13
18
|
|
|
19
|
+
## Why regexlab
|
|
20
|
+
|
|
21
|
+
You wrote a regex six months ago. You don't remember what it does. Today's reviewer wants you to explain it. Stack Overflow answers from 2014 paraphrase, regex101 wants your network and your eyes, and the real `man re_format(7)` is hostile if you only need it twice a year. regexlab is the explainer that lives in your terminal — local, offline-capable, no popovers.
|
|
22
|
+
|
|
14
23
|
## Install
|
|
15
24
|
|
|
16
25
|
```bash
|
|
17
|
-
npm install -g
|
|
26
|
+
npm install -g @v0idd0/regexlab
|
|
18
27
|
```
|
|
19
28
|
|
|
20
29
|
## Usage
|
|
@@ -45,14 +54,32 @@ regexlab --help
|
|
|
45
54
|
- Backreferences: `\1` through `\9`
|
|
46
55
|
- Flags: `g`, `i`, `m`, `s`, `u`, `y`
|
|
47
56
|
|
|
48
|
-
##
|
|
57
|
+
## Compared to alternatives
|
|
58
|
+
|
|
59
|
+
| tool | offline? | network IO | per-token explanation | regex101-style match testing |
|
|
60
|
+
|---|---|---|---|---|
|
|
61
|
+
| regexlab | yes | none | yes | optional via API |
|
|
62
|
+
| regex101.com | no | tracks input | yes | yes (web) |
|
|
63
|
+
| regexr.com | no | tracks input | yes | yes (web) |
|
|
64
|
+
| `pcregrep --explain` | yes | none | terse | no |
|
|
65
|
+
| ChatGPT/Claude | depends | sends pattern | conversational | manual |
|
|
66
|
+
|
|
67
|
+
If you're authoring a long regex and want hover-to-test feedback, regex101 is unbeatable. If you're explaining a regex *in your terminal* (in a code review, in a hook, on a server you SSHed into), regexlab is the one that fits the workflow.
|
|
68
|
+
|
|
69
|
+
## FAQ
|
|
70
|
+
|
|
71
|
+
**Does it actually run the regex against test strings?** Only via the programmatic API (returns matches if you pass a `subject` string). The CLI is explanation-only because that's the dominant use case.
|
|
49
72
|
|
|
50
|
-
|
|
73
|
+
**Is it accurate on PCRE-only features?** Most of what JavaScript's RegExp supports is the safe subset. Lookbehinds, named groups, atomic groups — covered. `\K` and balanced groups (.NET) are explicitly out of scope and the parser will say so.
|
|
74
|
+
|
|
75
|
+
**Why doesn't it suggest a "better" regex?** Because "better" depends on whether you're optimizing for readability, backtracking safety, or one of nine character-class alternatives. Static suggestions miss the point — regexlab explains, doesn't editorialize.
|
|
76
|
+
|
|
77
|
+
**Will it choke on a 4KB regex?** Try us. The tokenizer is recursive descent and has been fed several embarrassingly large captcha-bypass regexes in testing. The output gets long before the tool gets slow.
|
|
51
78
|
|
|
52
79
|
## Programmatic API
|
|
53
80
|
|
|
54
81
|
```javascript
|
|
55
|
-
import { explain, format } from '
|
|
82
|
+
import { explain, format } from '@v0idd0/regexlab';
|
|
56
83
|
|
|
57
84
|
const result = explain('/^\\d{3}-\\d{4}$/g');
|
|
58
85
|
console.log(format(result));
|
|
@@ -62,6 +89,14 @@ console.log(result.tokens);
|
|
|
62
89
|
// [{ token: '\\d{3}', explanation: '...' }, ...]
|
|
63
90
|
```
|
|
64
91
|
|
|
92
|
+
## More from the studio
|
|
93
|
+
|
|
94
|
+
This is one tool out of many — see [`from-the-studio.md`](from-the-studio.md) for the full lineup of vøiddo products (other CLI tools, browser extensions, the studio's flagship products and games).
|
|
95
|
+
|
|
65
96
|
## License
|
|
66
97
|
|
|
67
|
-
MIT
|
|
98
|
+
MIT.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
Built by [vøiddo](https://voiddo.com/) — a small studio shipping AI-flavoured products, free dev tools, Chrome extensions and weird browser games.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v0idd0/regexlab",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "regexlab
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "regexlab — explain regex patterns in plain English. Token-by-token breakdown: anchors, character classes, quantifiers, groups, lookarounds, flags. CLI + library. Free forever from vøiddo.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"developer-tools",
|
|
19
19
|
"voiddo"
|
|
20
20
|
],
|
|
21
|
-
"author": "
|
|
21
|
+
"author": "vøiddo <support@voiddo.com> (https://voiddo.com)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"homepage": "https://tools.voiddo.com/regexlab/",
|
|
24
24
|
"repository": {
|
|
@@ -36,9 +36,18 @@
|
|
|
36
36
|
"node": ">=14"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
|
-
"bin",
|
|
40
|
-
"src",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
]
|
|
39
|
+
"bin/",
|
|
40
|
+
"src/",
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"os": [
|
|
45
|
+
"darwin",
|
|
46
|
+
"linux",
|
|
47
|
+
"win32"
|
|
48
|
+
],
|
|
49
|
+
"funding": {
|
|
50
|
+
"type": "individual",
|
|
51
|
+
"url": "https://voiddo.com/contact/"
|
|
52
|
+
}
|
|
44
53
|
}
|