Skip to content

Commit f75c9a6

Browse files
Added 'flags' to RegExp.prototype.
1 parent d3dd48f commit f75c9a6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/lib/core.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ interface RegExp {
823823
*/
824824
test(string: string): boolean;
825825

826-
/** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */
826+
/** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
827827
source: string;
828828

829829
/** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */

src/lib/es6.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,20 @@ interface RegExp {
624624
*/
625625
split(string: string, limit?: number): string[];
626626

627+
/**
628+
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
629+
* The characters in this string are sequenced and concatenated in the following order:
630+
*
631+
* - "g" for global
632+
* - "i" for ignoreCase
633+
* - "m" for multiline
634+
* - "u" for unicode
635+
* - "y" for sticky
636+
*
637+
* If no flags are set, the value is the empty string.
638+
*/
639+
flags: string;
640+
627641
/**
628642
* Returns a Boolean value indicating the state of the sticky flag (y) used with a regular
629643
* expression. Default is false. Read-only.

0 commit comments

Comments
 (0)