UNPKG

@imhonglu/pattern-builder

Version:

Type-safe regular expression pattern builder for TypeScript with fluent API

34 lines 1 kB
import { Characters } from "../pattern-builder/characters.js"; import type { PatternInput } from "../types/pattern-input.js"; /** * Creates a pattern builder for the character set operator. * * @param patterns - The patterns to create the character set operator from. * @returns The pattern builder. * * @example pre-defined pattern with string * ```ts * characterSet(alpha, '#!'); * // => /[a-zA-Z#!]/ * ``` * * @example pre-defined pattern with pattern * ```ts * characterSet(digit, /[a-fA-F]/); * // => /[\da-fA-F]/ * ``` * * @example only string * ```ts * characterSet("a", "b", "c"); * // => /[abc]/ * ``` */ export declare function characterSet(...patterns: PatternInput[]): Characters; /** The pre-defined digit pattern. */ export declare const digit: Characters; /** The pre-defined alpha pattern. */ export declare const alpha: Characters; /** The pre-defined hex digit pattern. */ export declare const hexDigit: Characters; //# sourceMappingURL=character-set.d.ts.map