鑑於像串塊:如何查找和替換文本塊中的字符串?
var copy = "Hello world what is the day @James Bond blah bah blah blah...";
使用jQuery/JS,給出:
var term = "James Bond";
var id = "XXXXXX";
我怎樣才能找到所有匹配與'@' + term
和返回是這樣的:
"Hello world what is the day @[XXXXXX:James Bond] blah bah blah blah..."
謝謝
是否有用戶輸入? – alex