diff --git a/src/helper.ts b/src/helper.ts index a3c467a..81d76b2 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -18,7 +18,7 @@ export const captureName = /^[a-zA-Z_][a-zA-Z0-9_]*$/; export const negatableTokens = /^\\[sdwb]$/; -export const flagString = /^[gmiyusd]*$/; +export const flagString = /^[dgimsuvy]*$/; /** * Check whether a given value is a template strings array. diff --git a/src/types.ts b/src/types.ts index b378b89..f6956d0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -104,33 +104,37 @@ export interface IncompleteToken { */ export enum Flag { /** - * Allows more than 1 match. + * Output match indices. */ - Global = 'g', + Indices = 'd', /** - * ^ and $ match start/end of line. + * Allows more than 1 match. */ - MultiLine = 'm', + Global = 'g', /** * Case insensitive. */ IgnoreCase = 'i', /** - * The next match must follow the previous one. + * ^ and $ match start/end of line. */ - Sticky = 'y', + MultiLine = 'm', + /** + * Dot matches newlines. + */ + SingleLine = 's', /** * Use full unicode. */ Unicode = 'u', /** - * Dot matches newlines. + * Use all unicode and character set features. */ - SingleLine = 's', + UnicodeSets = 'v', /** - * Output match indices. + * The next match must follow the previous one. */ - Indices = 'd', + Sticky = 'y', } export type FlagUnion = `${Flag}`;