Baseline Widely available
dotAll
ìì±ì s
íëê·¸ê° ì ê·ìê³¼ í¨ê» ì¬ì©ëëì§ ì¬ë¶ë¥¼ ëíë
ëë¤. dotAll
ì ê°ë³ ì ê·ì ì¸ì¤í´ì¤ì ì½ê¸° ì ì© ìì±ì
ëë¤.
const regex1 = new RegExp("foo", "s");
console.log(regex1.dotAll);
// Expected output: true
const regex2 = new RegExp("bar");
console.log(regex2.dotAll);
// Expected output: false
ì¤ëª
dotAll
ì ê°ì Boolean
ì¼ë¡ s
íëê·¸ê° ì¬ì©ë ê²½ì° true
, ê·¸ë ì§ ìì¼ë©´ false
ì
ëë¤. s
íëê·¸ë ì í¹ì 문ì(.
)ê° ë¬¸ìì´ì ë¤ì ì¤ ì¢
ê²°ì("newline") 문ìì ì¶ê°ë¡ ì¼ì¹í´ì¼ í¨ì ëíë
ëë¤. ê·¸ë ì§ ìì¼ë©´ ì¼ì¹íì§ ììµëë¤.
\n
)\r
)ì´ê²ì ì¬ì¤ì ì ì´ ì ëì½ë BMP(Basic Multilingual Plane)ì 모ë 문ìì ì¼ì¹íë¤ë ê²ì ì미í©ëë¤. ë³ ê¸°í¸ì ì¼ì¹íëë¡ íë ¤ë©´ u
(ì ëì½ë) íë그를 ì¬ì©í´ì¼ í©ëë¤. ë íë그를 í¨ê» ì¬ì©íë©´ ìì¸ ìì´ ì ì´ ëª¨ë ì ëì½ë 문ìì ì¼ì¹íëë¡ ë§ë¤ ì ììµëë¤.
dotAll
ì set ì ê·¼ìë undefined
, ì¦ ì ìëì§ ìììµëë¤. ì´ ìì±ì ì§ì ë³ê²½í ì ììµëë¤.
dotAll
ì¬ì©í기
const str1 = "bar\nexample foo example";
const regex1 = /bar.example/s;
console.log(regex1.dotAll); // true
console.log(str1.replace(regex1, "")); // foo example
const str2 = "bar\nexample foo example";
const regex2 = /bar.example/;
console.log(regex2.dotAll); // false
console.log(str2.replace(regex2, ""));
// bar
// example foo example
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ë³´ê¸°
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4