Skip to content

Commit d41e04a

Browse files
committed
Better wording
1 parent 808756e commit d41e04a

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

files/en-us/web/javascript/reference/global_objects/regexp/flags/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.flags
2+
title: RegExp.prototype.flags
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/flags
44
tags:
55
- ECMAScript 2015
@@ -20,11 +20,11 @@ The **`flags`** accessor property represents the [flags](/en-US/docs/Web/JavaScr
2020

2121
## Description
2222

23-
`RegExp.prototype.flags` is a getter-only property that returns a string. Flags in the `flags` property are sorted alphabetically (from left to right, e.g. `"dgimsuy"`). It actually invokes the other flag accessors ([`hasIndices`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/hasIndices), [`global`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global), etc.) one-by-one and concatenates the results.
23+
`RegExp.prototype.flags` has a string as its value. Flags in the `flags` property are sorted alphabetically (from left to right, e.g. `"dgimsuy"`). It actually invokes the other flag accessors ([`hasIndices`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/hasIndices), [`global`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global), etc.) one-by-one and concatenates the results.
2424

2525
All built-in functions read the `flags` property instead of reading individual flag accessors.
2626

27-
You cannot change this property directly.
27+
The set accessor of `flag` is `undefined`. You cannot change this property directly.
2828

2929
## Examples
3030

files/en-us/web/javascript/reference/global_objects/regexp/global/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.global
2+
title: RegExp.prototype.global
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/global
44
tags:
55
- JavaScript
@@ -18,11 +18,11 @@ The **`global`** accessor property indicates whether or not the `g` flag is used
1818

1919
## Description
2020

21-
`RegExp.prototype.global` is a getter-only property that returns `true` if the `g` flag was used; otherwise, `false`. The `g` flag indicates that the regular expression should be tested against all possible matches in a string. Each call to [`exec()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) will update its [`lastIndex`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) property, so that the next call to `exec()` will start at the next character.
21+
`RegExp.prototype.global` has the value `true` if the `g` flag was used; otherwise, `false`. The `g` flag indicates that the regular expression should be tested against all possible matches in a string. Each call to [`exec()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) will update its [`lastIndex`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) property, so that the next call to `exec()` will start at the next character.
2222

2323
Some methods, such as [`String.prototype.matchAll()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll) and [`String.prototype.replaceAll()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll), will validate that, if the parameter is a regex, it is global. The regex's [`@@match`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match) and [`@@replace`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace) methods (called by [`String.prototype.match()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) and [`String.prototype.replace()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)) would also have different behaviors when the regex is global.
2424

25-
You cannot change this property directly.
25+
The set accessor of `global` is `undefined`. You cannot change this property directly.
2626

2727
## Examples
2828

files/en-us/web/javascript/reference/global_objects/regexp/hasindices/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.hasIndices
2+
title: RegExp.prototype.hasIndices
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/hasIndices
44
tags:
55
- JavaScript
@@ -18,9 +18,9 @@ The **`hasIndices`** accessor property indicates whether or not the `d` flag is
1818

1919
## Description
2020

21-
`RegExp.prototype.hasIndices` is a getter-only property that returns `true` if the `d` flag was used; otherwise, `false`. The `d` flag indicates that the result of a regular expression match should contain the start and end indices of the substrings of each capture group. It does not change the regex's interpretation or matching behavior in any way, but only enables additional information in the matching result.
21+
`RegExp.prototype.hasIndices` has the value `true` if the `d` flag was used; otherwise, `false`. The `d` flag indicates that the result of a regular expression match should contain the start and end indices of the substrings of each capture group. It does not change the regex's interpretation or matching behavior in any way, but only enables additional information in the matching result.
2222

23-
You cannot change this property directly.
23+
The set accessor of `hasIndices` is `undefined`. You cannot change this property directly.
2424

2525
## Examples
2626

files/en-us/web/javascript/reference/global_objects/regexp/ignorecase/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.ignoreCase
2+
title: RegExp.prototype.ignoreCase
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase
44
tags:
55
- JavaScript
@@ -18,11 +18,11 @@ The **`ignoreCase`** accessor property indicates whether or not the `i` flag is
1818

1919
## Description
2020

21-
`RegExp.prototype.ignoreCase` is a getter-only property that returns `true` if the `i` flag was used; otherwise, `false`. The `i` flag indicates that case should be ignored while attempting a match in a string.
21+
`RegExp.prototype.ignoreCase` has the value `true` if the `i` flag was used; otherwise, `false`. The `i` flag indicates that case should be ignored while attempting a match in a string.
2222

2323
If the regex has the [unicode](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag, the case mapping happens as specified in [`CaseFolding.txt`](https://unicode.org/Public/UCD/latest/ucd/CaseFolding.txt). Otherwise, it uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html) — the same algorithm used in [`String.prototype.toUpperCase()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) and [`String.prototype.toLowerCase()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase).
2424

25-
You cannot change this property directly.
25+
The set accessor of `ignoreCase` is `undefined`. You cannot change this property directly.
2626

2727
## Examples
2828

files/en-us/web/javascript/reference/global_objects/regexp/multiline/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.multiline
2+
title: RegExp.prototype.multiline
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/multiline
44
tags:
55
- JavaScript
@@ -18,9 +18,9 @@ The **`multiline`** accessor property indicates whether or not the `m` flag is u
1818

1919
## Description
2020

21-
`RegExp.prototype.multiline` is a getter-only property that returns `true` if the `m` flag was used; otherwise, `false`. The `m` flag indicates that a multiline input string should be treated as multiple lines. For example, if `m` is used, `^` and `$` change from matching at only the start or end of the entire string to the start or end of any line within the string.
21+
`RegExp.prototype.multiline` has the value `true` if the `m` flag was used; otherwise, `false`. The `m` flag indicates that a multiline input string should be treated as multiple lines. For example, if `m` is used, `^` and `$` change from matching at only the start or end of the entire string to the start or end of any line within the string.
2222

23-
You cannot change this property directly.
23+
The set accessor of `multiline` is `undefined`. You cannot change this property directly.
2424

2525
## Examples
2626

files/en-us/web/javascript/reference/global_objects/regexp/sticky/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.sticky
2+
title: RegExp.prototype.sticky
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/sticky
44
tags:
55
- ECMAScript 2015
@@ -20,13 +20,13 @@ The **`sticky`** accessor property indicates whether or not the `y` flag is used
2020

2121
## Description
2222

23-
`RegExp.prototype.sticky` is a getter-only property that returns `true` if the `y` flag was used; otherwise, `false`. The `y` flag indicates that it matches only from the index indicated by the {{jsxref("RegExp.lastIndex", "lastIndex")}} property of this regular expression in the target string (and does not attempt to match from any later indexes).
23+
`RegExp.prototype.sticky` has the value `true` if the `y` flag was used; otherwise, `false`. The `y` flag indicates that it matches only from the index indicated by the {{jsxref("RegExp.lastIndex", "lastIndex")}} property of this regular expression in the target string (and does not attempt to match from any later indexes).
2424

2525
When the [`exec()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) method is called and the regex fails to match at the current position indicated by {{jsxref("RegExp.lastIndex", "lastIndex")}}, a global regex will continue to attempt at the next character, while a sticky regex immediately returns `null` and resets `lastIndex` to 0. When the match succeeds, `lastIndex` is advanced to the end of the match, just like global regexps do. When `lastIndex` is out of bounds of the currently matched string, it's reset to 0, just like global regexps do.
2626

2727
For the [`exec()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) method, a regex that's both sticky and [global](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) behaves the same as a sticky and non-global regex. However, due to many other methods special-casing the behavior of global regexps, the global flag is, in general, orthogonal to the sticky flag. For more information about how each individual regex-related method (such as [`String.prototype.match()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) and [`String.prototype.replace()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)) interact with the sticky and global flags, see their respective pages.
2828

29-
You cannot change this property directly.
29+
The set accessor of `sticky` is `undefined`. You cannot change this property directly.
3030

3131
## Examples
3232

files/en-us/web/javascript/reference/global_objects/regexp/unicode/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: get RegExp.prototype.unicode
2+
title: RegExp.prototype.unicode
33
slug: Web/JavaScript/Reference/Global_Objects/RegExp/unicode
44
tags:
55
- ECMAScript 2015
@@ -19,13 +19,13 @@ The **`unicode`** accessor property indicates whether or not the `u` flag is use
1919

2020
## Description
2121

22-
`RegExp.prototype.unicode` is a getter-only property that returns `true` if the `u` flag was used; otherwise, `false`. The `u` flag enables various Unicode-related features. With the "u" flag:
22+
`RegExp.prototype.unicode` has the value `true` if the `u` flag was used; otherwise, `false`. The `u` flag enables various Unicode-related features. With the "u" flag:
2323

2424
- Any [Unicode codepoint escapes](/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes) (`\u{xxxx}`, `\p{UnicodePropertyValue}`) will be interpreted as such instead of literal characters.
2525
- Surrogate pairs will be interpreted as whole characters instead of two separate characters. For example, `/[😄]/u` would only match `"😄"` but not `"\ud83d"`.
2626
- When [`lastIndex`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) is automatically advanced (such as when calling [`exec()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)), unicode regexps advance by Unicode codepoints instead of UTF-16 code units.
2727

28-
You cannot change this property directly.
28+
The set accessor of `unicode` is `undefined`. You cannot change this property directly.
2929

3030
## Examples
3131

0 commit comments

Comments
 (0)