1. 정규식 생성 방식

var reg1 = /a/;        // constant
var reg2 = new RegExp(“a”);       //changing

2. Symbols

.   : any single character, except line breaks
*   : 0 or more matched
+   : 1 or more matched
?   : 0 or 1 matched
^   : begin with string
$   : end with string

3. Characters

\d   : any single digit matched
\w   : any word character(alphanumeric & underscore)
[XYZ]  or [A-Z]  : any single character matched from within the brackets. 
[XYZ]+   : 1 or more matched from within the brackets
[^A-Z]   : ^ is negation. nothing matched A-Z

4. Flags

g   : global search
I   : case intensive search

'JavaScript' 카테고리의 다른 글

null Vs. undefined Vs. NaN  (0) 2020.12.04
Template Literals  (0) 2020.12.03
Prototype  (0) 2020.12.03
즉시 실행 함수(IIFE: Immediately Invoked Function Expression)  (0) 2020.12.02
Callback, Promise, Observable and Async/await  (0) 2020.12.02

+ Recent posts