10.07.2017 Views

javascript_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Javascript<br />

m<br />

g<br />

Specifies that if the string has newline or carriage return<br />

characters, the ^ and $ operators will now match against a newline<br />

boundary, instead of a string boundary<br />

Performs a global matchthat is, find all matches rather than<br />

stopping after the first match.<br />

RegExp Properties<br />

Here is a list of the properties associated with RegExp and their description.<br />

Property<br />

Description<br />

constructor Specifies the function that creates an object's<br />

prototype.<br />

global<br />

ignoreCase<br />

lastIndex<br />

multiline<br />

source<br />

Specifies if the "g" modifier is set.<br />

Specifies if the "i" modifier is set.<br />

The index at which to start the next match.<br />

Specifies if the "m" modifier is set.<br />

The text of the pattern.<br />

In the following sections, we will have a few examples to demonstrate the usage<br />

of RegExp properties.<br />

constructor<br />

It returns a reference to the array function that created the instance's prototype.<br />

Syntax<br />

Its syntax is as follows:<br />

RegExp.constructor<br />

Return Value<br />

Returns the function that created this object's instance.<br />

312

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!