AJAX - The Complete Reference

(avery) #1

PART IV


Appendix A: JavaScript Quick Reference 585


Code Matches
\f Form feed

\n Newline
\r Carriage return
\t Tab

\v Vertical tab
\/ Foreslash (“/”)
\\ Backslash (“\”)
\. Period (“.”)

\* Asterisk (“*”)
\+ Plus sign (“+”)
\? Question mark (“?”)
\| Horizontal bar, aka pipe “(|)”

\( Left parenthesis (“(“)
\) Right parenthesis (“)”)
\[ Left bracket (“[“)

\] Right bracket (“]”)
\{ Left curly brace (“{“)
\} Right curly brace (“}”)
\OOO ASCII character represented by octal value OOO

\xHH ASCII character represented by hexadecimal value HH
\uHHHH Unicode character represented by the hexadecimal value HHHH
\cX Control character represented by ^X, for example, \cH represents CTRL-H

TABLE A-24 Regular Expression Escape Codes

Feature Description
(?:expr) Noncapturing parentheses. Does not make the given parenthesized
subexpression expr available for backreferencing.

(?=expr) Positive lookahead. Forces the previous item to match only if it is followed by
a string that matches expr. The text that matched expr is not included in the
match of the previous item.
(!expr) Negative lookahead. Forces the previous item to match only if it is not
followed by a string matching expr. The text that did not match expr is not
included in the match of the previous item.
? Nongreedy matching. Forces the immediately preceding repetition quantifier
to match the minimum number of characters required.

TABLE A-25 Advanced Regular Expression Features
Free download pdf