English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript RegExp global Property

 JavaScript RegExp RegExp Object

The global property indicates whether the "gmarker (modifier) is used with the regular expression.

If the 'gIf the modifier is set, this property returns true, otherwise it returns false.

Syntax:

regex.global
var str = "Hello world";
var regex = /Hello/g;
regex.global; // true
Test See </›

Browser Compatibility

All browsers fully support the global property:

Properties
globalYesYesYesYesYes

Technical Details

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

 JavaScript RegExp RegExp Object