UNPKG

ts-regex-builder

Version:

Maintainable regular expressions for TypeScript and JavaScript.

35 lines (34 loc) 1.29 kB
import type { CharacterClass, CharacterEscape, EncodedRegex } from '../types'; /** * Creates a character class which matches any one of the given characters. * * @param elements - Member characters or character ranges. * @returns Character class. */ export declare function charClass(...elements: Array<CharacterClass | CharacterEscape>): CharacterClass; /** * Creates a character class which matches any one of the characters in the range. * * @param start - Start of the range (single character). * @param end - End of the range (single character). * @returns Character class. */ export declare function charRange(start: string, end: string): CharacterClass; /** * Creates a character class which matches any one of the given characters. * * @param chars - Characters to match. * @returns Character class. */ export declare function anyOf(chars: string): CharacterClass; /** * Creates a negated character class which matches any character that is not in the given character class. * * @param element - Character class or character escape to negate. * @returns Negated character class. */ export declare function negated(element: CharacterClass | CharacterEscape): EncodedRegex; /** * @deprecated Renamed to `negated`. */ export declare const inverted: typeof negated;