RegExp.prototype.compile()
Deprecated
Avoid using this feature in new projects.
The compile() method duplicates behavior of the RegExp() constructor and it exists only for backwards compatibility.
This feature may be a candidate for removal from web standards or browsers. >
ì°¸ê³ :
compile() ë©ìëë í¸íì±ì ìí´ìë§ ëª
ìëì´ ììµëë¤. compile()ì ì¬ì©íë©´ ë³ê²½ ë¶ê°ë¥í ì ê·ì ìì¤ì íëê·¸ê° ë³ê²½ ê°ë¥íë¯ë¡ ì¬ì©ìì ììì ë¹ëê° ì ììµëë¤. ëì RegExp() ìì±ì를 ì¬ì©íì¬ ì ì ê·ì ê°ì²´ë¥¼ ìì±í ì ììµëë¤.
RegExp ì¸ì¤í´ì¤ì compile() ë©ìëë RegExp ê°ì²´ê° ì´ë¯¸ ìì±ë í ìë¡ì´ ìì¤ì íë그를 ì¬ì©íì¬ ì ê·ìì ë¤ì ì»´íì¼íë ë° ì¬ì©ë©ëë¤.
구문
compile(pattern, flags)
매ê°ë³ì
pattern-
ì ê· ííì í ì¤í¸
flags-
íëê·¸ ê°ì ì¡°í©.
ë°í ê°
ìì (undefined).
ìì
>compile() ì¬ì©í기
ë¤ì ìì ë ìë¡ì´ í¨í´ê³¼ ìë¡ì´ íë그를 ì¬ì©íì¬ ì ê·ìì ë¤ì ì»´íì¼íë ë°©ë²ì ë³´ì¬ ì¤ëë¤.
const regexObj = new RegExp("foo", "gi");
regexObj.compile("new foo", "g");
ëª ì¸ì
| Specification |
|---|
| ECMAScript® 2027 Language Specification > # sec-regexp.prototype.compile > |