From f75c9a66248d28b8cd4e879b67b6b685b347fcb6 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 9 Apr 2015 12:52:31 -0700 Subject: [PATCH] Added 'flags' to RegExp.prototype. --- src/lib/core.d.ts | 2 +- src/lib/es6.d.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 3d830ae5203..822b7ca5202 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -823,7 +823,7 @@ interface RegExp { */ test(string: string): boolean; - /** 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. */ + /** 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. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 83ae724b768..2af11c92ab9 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -624,6 +624,20 @@ interface RegExp { */ split(string: string, limit?: number): string[]; + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; + /** * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular * expression. Default is false. Read-only.