regular expression
summary
operators
$ ( ) * + . ? [ \ ] ^ { | }

control characters
\0 [\b] \f \n \r \t \v

general escapes
\cX \xhh \uhhhh

character classes
. [xyz] [^xyz] \w \W \s \S \d \D

quantifiers
*  +  ?  {n}  {n,}  {n,m}
*? +? ?? {n}? {n,}? {n,m}?

assertions
^ $ \A \Z \z \b \B
JavaScript literal format
var s,r,a;
s = "a'b\"c/d";
r = /'\w"\w\//i;
a = s.match(r);




 
JavaScript construction function
var s,r,a;
s = "a'b\"c/d";
r = new RegExp("'\\w\"\\w/","i");
a = s.match(r);




 
PHP
$s = "a'b\"c/d";
$r = '/\'\\w"\\w\\//i';
preg_match($r,$s,$a);




 
procedures
1. string
a'b"c/d

2. regular expression
'\w"\w/

3-1. for JavaScript literal format
Escape /
r = /'\w"\w\//i;

3-2. for JavaScript construction function
Escape \ and "
r = new RegEx("'\\w\"\\w/","i");

3-3. for PHP
Escape \ and ' and /
$r = '/\'\\w"\\w\//i';
Qindex.info