//#region src/patterning.d.ts /** * Create a "capturing" group with the pattern provided by all arguments * merged into a single regex. * * @remarks * pure function * * @example * ```typescript * capture(/a/, /b/, /c/) === /(abc)/ * ``` */ declare const capture: (...p: RegExp[]) => RegExp; /** * Create a pattern using a template string and dict(ionary) of terms. * * @param dict an object with keys/properties that are RegExp objects that will * be used in the template string * @param template the definition of the pattern to build using the dict(ionary) * patterns * * @remarks * pure function * * @example * ```typescript * fromTemplate({ a: /alpha/, b: /beta/, ' ': / / }, 'a b') === /^alpha beta$/ * ``` * */ declare const fromTemplate: (dict: Record, template: string) => RegExp; /** * Create a "non-capturing" group with the pattern provided by all arguments * merged into a single regex. * * @remarks * pure function * * @example * ```typescript * group(/a/, /b/, /c/) === /(?:abc)/ * ``` */ declare const group: (...p: RegExp[]) => RegExp; /** * Concatenate all of the provided patterns into a single pattern; each * subsequent argument is joined with the previous with no "qualifier" between * them. * * @remarks * pure function * * @example * ```typescript * merge(/a/, /b/, /c/) === /abc/ * ``` */ declare const merge: (...all: RegExp[]) => RegExp; /** * Create an "optional" "non-capturing" group with the pattern provided by all * arguments merged into a single regex. * * @remarks * pure function * * @example * ```typescript * optional(/a/, /b/, /c/) === /(?:abc)?/ * ``` */ declare const optional: (...p: RegExp[]) => RegExp; //#endregion export { capture, fromTemplate, group, merge, optional }; //# sourceMappingURL=patterning.d.ts.map