ret
- Version 0.5.0
- Published
- 69.2 kB
- No dependencies
- MIT license
Install
npm i ret
yarn add ret
pnpm add ret
Overview
Tokenizes a string that represents a regular expression.
Index
Functions
function reconstruct
reconstruct: (token: Tokens) => string;
function tokenizer
tokenizer: (regexpStr: string) => Root;
Tokenizes a regular expression (that is currently a string)
Parameter regexpStr
String of regular expression to be tokenized
Returns
{Root}
Interfaces
Enums
enum types
enum types { ROOT = 0, GROUP = 1, POSITION = 2, SET = 3, RANGE = 4, REPETITION = 5, REFERENCE = 6, CHAR = 7,}
Type Aliases
type Char
type Char = ValueType<types.CHAR, number>;
type Group
type Group = Base< types.GROUP, { stack?: Token[]; options?: Token[][]; remember: boolean; followedBy?: boolean; notFollowedBy?: boolean; lookBehind?: boolean; name?: string; }>;
type Position
type Position = ValueType<types.POSITION, '$' | '^' | 'b' | 'B'>;
type Range
type Range = Base< types.RANGE, { from: number; to: number; }>;
type Reference
type Reference = ValueType<types.REFERENCE, number>;
type Repetition
type Repetition = Base< types.REPETITION, { min: number; max: number; value: Token; }>;
type Root
type Root = Base< types.ROOT, { stack?: Token[]; options?: Token[][]; flags?: string[]; }>;
type Set
type Set = Base< types.SET, { set: SetTokens; not: boolean; }>;
type SetTokens
type SetTokens = (Range | Char | Set)[];
type Token
type Token = Group | Position | Set | Range | Repetition | Reference | Char;
type Tokens
type Tokens = Root | Token;
Package Files (6)
Dependencies (0)
No dependencies.
Dev Dependencies (7)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ret
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ret)
- HTML<a href="https://www.jsdocs.io/package/ret"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1401 ms. - Missing or incorrect documentation? Open an issue for this package.