ts-regex-builder
Version:
Maintainable regular expressions for TypeScript and JavaScript.
26 lines (25 loc) • 970 B
TypeScript
import type { EncodedRegex, RegexSequence } from '../types';
export interface QuantifierOptions {
greedy?: boolean;
}
/**
* Creates a quantifier which matches zero or more of the given elements.
*
* @param sequence - Elements to match zero or more of.
* @param options - Quantifier options.
*/
export declare function zeroOrMore(sequence: RegexSequence, options?: QuantifierOptions): EncodedRegex;
/**
* Creates a quantifier which matches one or more of the given elements.
*
* @param sequence - Elements to match one or more of.
* @param options - Quantifier options.
*/
export declare function oneOrMore(sequence: RegexSequence, options?: QuantifierOptions): EncodedRegex;
/**
* Creates a quantifier which matches zero or one of the given elements.
*
* @param sequence - Elements to match zero or one of.
* @param options - Quantifier options.
*/
export declare function optional(sequence: RegexSequence, options?: QuantifierOptions): EncodedRegex;