JavaScript RegExp global property

Definition and usage

global The property specifies whether the "g" modifier is set.

If set "g" modifier, then this property returns true, otherwise return false.

Description

The property of RegExp object global The property is a read-only Boolean value.

It specifies whether the regular expression performs a global match, such as whether the flag g was used when it was created.

Example

let pattern = /W3S/g;
let result = pattern.global;

Try it yourself

Syntax

regexp.global

Return value

Type Description
Boolean value If the "g" modifier is set, it returns true, otherwise it returns false.

browser support

global wani ECMAScript1 (ES1) ɗaɗin.

Kowane ɗanarorin sun kammala da ɗanarorin ES1 (JavaScript 1997):

Chrome IE Edge Firefox Safari Opera
Gudanarwa Gudanarwa Gudanarwa Gudanarwa Gudanarwa Gudanarwa