JavaScript 正则表达式 dotAll 属性
示例
const pattern = /W3Schools/s;
let result = pattern.dotAll;亲自试一试 »
const pattern = /W3Schools/
let result = pattern.dotAll;亲自试一试 »描述
dotAll 属性在表达式中设置了 s 修饰符时返回 true。
语法
regexp.dotAll
参数
| NONE |
返回值
| 类型 | 描述 |
|---|---|
| 布尔值 | true 如果设置了 s 修饰符,则为 true,否则为 false。 |
浏览器支持
regexp.dotAll 是 JavaScript 2018 的一项特性。
ES 2018 自 2020 年 6 月起,所有现代浏览器均已支持 ES 2018。
| Chrome 63 |
Edge 79 |
Firefox 78 |
Safari 12 |
Opera 50 |
| 2017年12月 | 2020年1月 | 2020年6月 | 2018年9月 | 2018年1月 |
