You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`arkregex` types are [extensively tested](https://github.com/arktypeio/arktype/tree/main/ark/regex/__tests__/regex.test.ts) and [benchmarked](https://github.com/arktypeio/arktype/tree/main/ark/regex/__tests__/regex.bench.ts) using [attest](https://github.com/arktypeio/arktype/tree/main/ark/attest#readme).
59
+
60
+
If anything not covered by the other FAQs is not behaving how you'd expect, please don't hesitate to [create an issue](https://github.com/arktypeio/arktype/issues/new).
61
+
62
+
#### How can I get syntax highlighting for `regex`?
63
+
64
+
The [ArkType extension](https://marketplace.visualstudio.com/items?itemName=arktypeio.arkdark) can be installed to add syntax highlighting to `regex` calls.
`arkregex` types are [extensively tested](https://github.com/arktypeio/arktype/tree/main/ark/regex/__tests__/regex.test.ts) and [benchmarked](https://github.com/arktypeio/arktype/tree/main/ark/regex/__tests__/regex.bench.ts) using [attest](https://github.com/arktypeio/arktype/tree/main/ark/attest#readme).
410
+
411
+
If anything not covered by the other FAQs is not behaving how you'd expect, please don't hesitate to [create an issue](https://github.com/arktypeio/arktype/issues/new).
412
+
413
+
#### How can I get syntax highlighting for `regex`?
414
+
415
+
The [ArkType extension](https://marketplace.visualstudio.com/items?itemName=arktypeio.arkdark) can be installed to add syntax highlighting to `regex` calls.
-**Types**: Infers string types for your existing regular expressions, including positional and named captures
25
25
-**Parity**: Supports 100% of [features](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions) allowed by `new RegExp()`
26
26
-**Safety**: Syntax errors like referencing a group that doesn't exist are now type errors
27
-
-**Zero Runtime**: Improves your type safety without impacting your bundle size[\*](#footnote)
27
+
-**Zero Runtime**: Improves your type safety without impacting your bundle size
28
28
29
-
## FAQ
29
+
###FAQ
30
30
31
-
### Why aren't some patterns like `[a-Z]` inferred more precisely?
31
+
####Why aren't some patterns like `[a-Z]` inferred more precisely?
32
32
33
33
Constructing string literal types for these sorts of expressions is combinatorial and will explode very quickly if we infer character ranges like this as literal characters.
34
34
35
35
We've tried to strike a balance between performance and precision while guaranteeing that the inferred types are at worst imprecise and never incorrect.
36
36
37
-
### Why doesn't it work with my massive RegExp?
37
+
####Why doesn't it work with my massive RegExp?
38
38
39
39
If your expression is especially long or complex, TypeScript won't be able to infer it.
`arkregex` types are [extensively tested](https://github.com/arktypeio/arktype/tree/main/ark/regex/__tests__/regex.test.ts) and [benchmarked](https://github.com/arktypeio/arktype/tree/main/ark/regex/__tests__/regex.bench.ts) using [attest](https://github.com/arktypeio/arktype/tree/main/ark/attest#readme).
52
+
53
+
If anything not covered by the other FAQs is not behaving how you'd expect, please don't hesitate to [create an issue](https://github.com/arktypeio/arktype/issues/new).
54
+
55
+
#### How can I get syntax highlighting for `regex`?
56
+
57
+
The [ArkType extension](https://marketplace.visualstudio.com/items?itemName=arktypeio.arkdark) can be installed to add syntax highlighting to `regex` calls.
0 commit comments