11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

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

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

Table A-32: Advanced Regular Expression Features<br />

Feature Description<br />

(?=expr) Positive lookahead. Forces the previous item to match only if it is followed<br />

by a string that matches expr. <strong>The</strong> text that matched expr is not included<br />

in the match of the previous item.<br />

(!expr) Negative lookahead. Forces the previous item to match only if it is not<br />

followed by a string matching expr. <strong>The</strong> text that did not match expr is not<br />

included in the match of the previous item.<br />

? Non-greedy matching. Forces the immediately preceding repetition<br />

quantifier to match the minimum number of characters required.<br />

Table A-33: Static Properties of the RegExp Object<br />

Property Value<br />

$1, $2, …, $9 Strings holding the text of the first nine parenthesized<br />

subexpressions of the most recent match.<br />

index Holds the string index value of the first character in the most recent<br />

pattern match. This property is not part of the ECMA standard,<br />

though it is supported widely. <strong>The</strong>refore it may be better to use the<br />

length of the RegExp pattern and the lastIndex property to<br />

calculate this value.<br />

input String containing the default string to match against the pattern.<br />

lastIndex Integer specifying the position in the string at which to start the next<br />

match. Same as the instance property, which should be used<br />

instead.<br />

lastMatch String containing the most recently matched text.<br />

lastParen String containing the text of the last parenthesized subexpression<br />

of the most recent match.<br />

leftContext String containing the text to the left of the most recent match.<br />

rightContext String containing the text to the right of the most recent match.<br />

Appendix B: <strong>JavaScript</strong> Object <strong>Reference</strong><br />

This appendix provides a reference for objects available in <strong>JavaScript</strong>, including their<br />

properties, methods, event handlers, and support under the popular browsers. <strong>The</strong> support site<br />

at www.javascriptref.com also has much of the information available in this appendix.<br />

Object Models<br />

An object model defines the interface used by scripts to examine and manipulate structured<br />

information, for example, an (X)HTML document. An object model defines the composition and<br />

characteristics of its constituent parts as well as how they may be operated upon. <strong>The</strong> ―big<br />

picture‖ of the <strong>JavaScript</strong> object models is shown in Figure B-1.

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

Saved successfully!

Ooh no, something went wrong!