HTML and CSS Reference
In-Depth Information
Regular Expression
A Regular Expression (RegExp) is used for pattern matching. The special characters
used for the patterns are described in Table G-28.
Table G-28 RegExp
Character
Description
/
Every pattern must begin with a slash
\d
Match any digit
\s
Match any space, newline, tab, return
\w
Match any alphanumeric character
^
Beginning of a string
$
End of a string
?
First of all characters (?xy) means x or xy
*
Multiple of characters (*xy) means x or xy or xyy
Multiple of all characters (xy 1 ) means xy, or xyy, or xyyy
1
[xx]
Used in brackets for alternatives; (Adobe CS[3456]) would return Adobe CS3, Adobe CS4,
Adobe CS5, or Adobe CS6
[x-x]
Used in brackets for sequence; (JavaScript 1.[1-5]) means JavaScript 1.1 or JavaScript 1.2, etc.
[^x-x]
Used in brackets to match anything BUT the selected characters; ([^w-y]) means any letter
but w through y
(x)
Subpattern
.
The dot means any character
{min, max}
The minimum or maximum number of sequences; (x{1,3}) means x or xx or xxx
Global Functions
Table G-29 summarizes the global functions that always are available in JavaScript.
Table G-29 Global Functions
Function
Description
decodeURI()
Decodes or replaces an escape sequence in the encoded URI with the character that
it represents; cannot decode escape sequence not coded by encoded URI
decodeURIComponent()
Decodes or replaces each escape sequence in the encoded URIComponent()
with the character that it represents
encodeURI()
Replaces all characters, except those with special meaning in a URI, with the
appropriate UTF-8 escape sequences
encodeURIComponent()
Assumes that the URI is not complete, and does not treat reserved Component()
characters as if they have special meaning and encodes them
escape()
Returns the hexadecimal code
eval()
Evaluates a string of JavaScript code without reference to a particular object
isFinite()
Evaluates an argument to determine whether it is a finite number
isNaN()
Evaluates an argument to determine if it is not a number
number()
Converts an object to a number
parseFloat()
Parses a string argument and returns a floating-point number
parseInt()
Parses a string argument and returns an integer
string()
Converts an object to a string
unescape()
Returns the ASCII string for the specified hexadecimal encoding value
Search WWH ::




Custom Search