1
此正則表達式匹配的搜索查詢在本example看到...引導正則表達式事先鍵入的內容 - 允許空白
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>'
})
我怎樣才能改變它,使其能夠在空白的結束了嗎?