File tree Expand file tree Collapse file tree 5 files changed +33
-10
lines changed
Expand file tree Collapse file tree 5 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ npm install @gruhn/regex-utils
2424
2525There is a high-level API and a low-level API:
2626
27- - [ high-level API documentation] ( https://gruhn.github.io/regex-utils/modules/high-level-api .html )
28- - [ low-level API documentation] ( https://gruhn.github.io/regex-utils/modules/low-level-api .html )
27+ - [ high-level API documentation] ( https://gruhn.github.io/regex-utils/modules/High-level_API .html )
28+ - [ low-level API documentation] ( https://gruhn.github.io/regex-utils/modules/Low-Level_API .html )
2929
3030The high-level API operates directly on native JavaScript ` RegExp ` instances,
3131which is more convenient but also requires parsing the regular expression.
Original file line number Diff line number Diff line change 11{
22 "name" : " @gruhn/regex-utils" ,
3+ "description" : " TypeScript library for regex intersection, complement and other utilities that go beyond string matching." ,
4+ "author" : " Niklas Gruhn" ,
5+ "license" : " MIT" ,
6+ "repository" : " github:gruhn/regex-utils" ,
37 "version" : " 0.0.0-development" ,
48 "type" : " module" ,
59 "scripts" : {
812 "build" : " tsc --project tsconfig.build.json && tsc-alias" ,
913 "build:docs" : " typedoc --tsconfig tsconfig.build.json"
1014 },
11- "main" : " ./dist/high-level-api .js" ,
15+ "main" : " ./dist/index .js" ,
1216 "exports" : {
1317 "." : {
14- "import" : " ./dist/high-level-api .js" ,
15- "types" : " ./dist/high-level-api .d.ts"
18+ "import" : " ./dist/index .js" ,
19+ "types" : " ./dist/index .d.ts"
1620 },
1721 "./low-level-api" : {
1822 "import" : " ./dist/low-level-api.js" ,
1923 "types" : " ./dist/low-level-api.d.ts"
2024 }
2125 },
22- "author" : " Niklas Gruhn" ,
23- "license" : " MIT" ,
24- "repository" : " github:gruhn/regex-utils" ,
2526 "files" : [
2627 " dist"
2728 ],
28- "description" : " TypeScript library for regex intersection, complement and other utilities that go beyond string matching." ,
2929 "devDependencies" : {
3030 "0x" : " ^5.8.0" ,
3131 "fast-check" : " ^3.23.2" ,
Original file line number Diff line number Diff line change 1+ /**
2+ * The high-level API operates directly on native JavaScript `RegExp` instances.
3+ * Use this if you want convenience. Use the low-level API if you want speed.
4+ *
5+ * @module High-level API
6+ */
7+
18import * as RE from './low-level-api'
29
310/**
Original file line number Diff line number Diff line change 1+ /**
2+ * The high-level API operates directly on native JavaScript `RegExp` instances.
3+ * The low-level API provides the same functions but operates on the custom data
4+ * types `StdRegex` (standard regex) and `ExtRegex` (extended regex).
5+ * Most of the additional functions are just a
6+ * [DSL](https://en.wikipedia.org/wiki/Domain-specific_language)
7+ * for constructing instances of these types.
8+ *
9+ * `ExtRegex` is a super-type of `StdRegex` and extends it with complement and
10+ * intersection operators which have no direct representation in standard regular
11+ * expressions. Some operations like `size` and `enumerate` only work on `StdRegex`.
12+ * `ExtRegex` can always be "compiled down" to `StdRegex` using `toStdRegex`.
13+ * But note that most computational cost is concentrated in this transformation.
14+ *
15+ * @module Low-Level API
16+ */
17+
118export {
219 parseRegExp as parse
320} from './regex-parser'
Original file line number Diff line number Diff line change 11{
2- "entryPoints" : [" src/high-level-api.ts" , " src/low-level-api.ts" ],
32 "navigationLinks" : {
43 "GitHub" : " https://github.com/gruhn/regex-utils"
54 }
You can’t perform that action at this time.
0 commit comments