#### Rest參數、spread擴展運算符
> ES6中已經引入,在ES9中為**對象**提供了像數組一樣的rest參數和擴展運算符
* rest參數在對象中的應用
~~~
function connect({host,port,...user}){
?console.log(host)
?console.log(port)
?console.log(user) ?// user是包含username和password的對象
}
conect({
?host:'127.0.0.1',
?port:3306,
?username:'root',
?password:'root'
})
~~~
~~~
// 傳統方式,沒用正則擴展
let str = '<a href="http://blog.mdashen.com">yishenBlog</a>'
const reg = /<a href="(.*)">(.*)<\/a>/
console.log(reg.exec(str)) //正則匹配href屬性的值,和標簽內容內容
// 正則擴展
const reg2 = /<a href="(?<url>.*)">(?<text>.*)<\/a>/ // 類似于給匹配到的內容起一個別名
~~~
~~~
let str = 'Js34342你知道嗎555啦啦啦'
const reg = /\d+(?=啦)/ // 匹配后面是'啦'的數值 正向斷言
const reg1 = /(?<=嗎)\d+/ // 匹配前面是'嗎'的數值 反向斷言
~~~
> dot . 元字符 除換行符以外的任意單個字符
>
> const reg = /正則內容/s ,末尾增加s,使'.'可以匹配換行符
##### 正則擴展-dotAll模式
> 正則匹配時,有多個匹配到的內容;可以根據目標前面或后面,來對目標進行唯一性識別
##### 正則擴展-反向斷言

##### 正則擴展-命名捕獲分組
[正則基礎知識-菜鳥教程](https://www.runoob.com/regexp/regexp-syntax.html) [自己總結的-xmind-藍奏云-下載路徑](https://mdashen.lanzous.com/iPO5Xepb7mj)
#### 正則擴展

> 可以將對象展開成key:value,的形式;與展開數組類似
* 擴展運算符在對象中的應用