Description
The global property specifies whether or not the 'g' modifier is set. The property returns true if the modifier is set, false otherwise.
This property has the form:
RegExpObject.global
Examples
The following example shows the basic use of this property.
<script>
var pattern=/Java/g;
if(pattern.global)
{
document.write("g mod: set");
}
else
{
document.write("g mod: not set");
}
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|