webproger > cheat sheets > study
 
htmlspecialchars()
170#219 SIBLINGS CHILDREN 219
 
JavaScript RegExp Reference
170#1497 SIBLINGS CHILDREN 1497
 
qesc()
<?php
function qesc($s,$m) {
    switch($m) {
        case 0:
            $s= str_replace("&" ,"&amp;" ,$s);
            return $s;
        case 8:
            $s= str_replace("&" ,"&amp;" ,$s);
            $s= str_replace("<" ,"&lt;"  ,$s);
            $ ...
170#8962 SIBLINGS CHILDREN 8962
 
Proverbs and Quotes in English
Short sentences and easy words.
 
qesc()
                              <title><?php echo qesc($s,0); ?></title>
                           <textarea><?php echo qesc($s,0); ?></textarea>
                                <div><?php echo qesc($s,8); ?></div>
<div style='font-family:courier new'><?ph ...
170#85 SIBLINGS CHILDREN 85
 
regular expression
170#4875 SIBLINGS CHILDREN 4875
 
regular expression 1 character escapes
1. Characters used as operators should be escaped.
<JavaScript>    $ ( ) * + . ? [ \ ] ^ { | }

2. Some control characters can be used with escapes.
<JavaScript>    \0, [\b], \f, \n, \r, \t, \v

3. General Escapes.
<JavaScript>
\cX       Where X is a lett ...
170#2393 SIBLINGS CHILDREN 2393
 
regular expression 2 character classes
<JavaScript>
.    (The decimal point) matches any single character except the newline character.
[xyz]    A character set. Matches any one of the enclosed characters. You can specify a range of characters by using a hyphen.
[^xyz]   A negated or complemen ...
170#4870 SIBLINGS CHILDREN 4870
 
regular expression 3 quantifiers
<JavaScript>
*       Specifies zero or more matches. Same as {0,}.
+       Specifies one or more matches. Same as {1,}.
?       Specifies zero or one matches. Same as {0,1}.
{n}     Specifies exactly n matches.
{n,}    Specifies at least n matches.
{n,m}  ...
170#4872 SIBLINGS CHILDREN 4872
 
regular expression 4 assertions
<JavaScript>
^     Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character.
$     Matches end of input. If the multiline flag is set to true, also matches immediately before a line break char ...
170#4873 SIBLINGS CHILDREN 4873
 
regular expression 5 usage
<JavaScript>
1. Creating a regular expression
literal format: aRegexp = /pattern/flags;
construction function: aRegexp = new RegExp("pattern"[, "flags"]);

2. Methods that use regular expressions
aRegexp.exec(aString);
aRegexp.test(aString);
aString.match ...
170#4874 SIBLINGS CHILDREN 4874
 
string conversion
170#83 SIBLINGS CHILDREN 83
 
Unicode
170#62 SIBLINGS CHILDREN 62

-