/** * Builds a regular expression object from a simple string pattern. * * A string pattern can use the following special characters: * - `*` to match any number of characters: `"foo*"` will match all strings starting with `"foo"` * - `?` to match a single character: `"foo?"` will match all strings of 4 characters that start with `"foo"` * - `\` to escape a special character: `\*` will be interpreted as `*`, and `\\` will be interpreted as `\` * * This is a replacement function for `ct/_string.stringPatternToRegExp`. * * @example * ```ts * import { createRegexFromPattern } from "apprt-core/string-pattern"; * const regex = createRegexFromPattern("foo*"); * const match = regex.test("foobar"); // true * ``` * * @param pattern a simple string pattern conforming to the rules above * @param ignoreCase whether the regular expression should be case insensitive (false by default) * @returns A regular expression implementing the pattern */ declare function createRegexFromPattern(pattern: string, ignoreCase?: boolean): RegExp; declare function regexEscape(val: string): string; export { createRegexFromPattern, createRegexFromPattern as default, regexEscape };