Java Reference
In-Depth Information
(continued)
character
exaMples
function
Matches a tab character.
\t
Matches a vertical tab character.
\v
/\w/ matches O in “ O?! ” and 1 in
$1 .”
Matches any alphanumeric character
or the underscore. This is identical to
[A‐Za‐z0‐9 _ ] .
\w
/\W/ matches $ in “ $10million
and @ in “ j_smith@wrox .”
Matches any non‐alphanumeric
character (excluding the underscore).
This is identical to [^A‐Za‐z0‐9 _ ] .
\W
/(Joh?n) and \1/ matches John
and John in “ John and John's
friend ” but does not match “ John
and Jon .”
Matches the last substring that
matched the n th match placed in
parentheses and remembered (where
n is a positive integer).
()\n
/\x25/ matches % .
Matches the character corresponding
to the specified octal or hexadecimal
escape value.
\octal\xhex
string
The String object is used to contain a string of characters. It was introduced in JavaScript 1.0.
This must be distinguished from a string literal, but the methods and properties of the String
object can also be accessed by a string literal, because a temporary object will be created when they
are called.
The HTML methods in the last table are not part of any ECMAScript standard, but they have been
part of the JavaScript language since version 1.0. They can be useful because they dynamically
generate HTML.
Properties
Property
Introduced
Description
JavaScript 1.1
Used to reference the constructor function for the
object.
constructor
JavaScript 1.0
Returns the number of characters in the string.
length
JavaScript 1.1
Returns the prototype for the object, which can be used
to extend the object's interface.
prototype
Search WWH ::




Custom Search