我有一個字符串"@{Name; [email protected]}"
正則表達式提取字符串
我想寫一個正則表達式提取Name
和11112121
從上面的字符串
這是我試過了。
function formatName(text){
var regex = /@\{([^;]+); ([^\}]+)\}/
return text.replace(
regex,
'$1, $2'
);
}
以上給出Name, [email protected]
。但我想只有Name, 11112121
的http:// WWW .phpliveregex.com/p/39L –