Skip to content

Commit

Permalink
Add v flag
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Aug 20, 2023
1 parent 4c378ba commit b0443f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 14 additions & 10 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit b0443f7

Please sign in to comment.