English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript RegExp RegExp Object
The global property indicates whether the "g
marker (modifier) is used with the regular expression.
If the 'g
If the modifier is set, this property returns true, otherwise it returns false.
regex.global
var str = "Hello world"; var regex = /Hello/g; regex.global; // trueTest See </›
All browsers fully support the global property:
Properties | |||||
global | Yes | Yes | Yes | Yes | Yes |
Writable: | No |
---|---|
Enumerable: | No |
Configurable: | Yes |
Return Value: | If the 'g' modifier is set, it returns true, otherwise it returns false. |
JavaScript Version: | ECMAScript 1 |