Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
试图在标记中找到“N/A”的实例并用其他东西换掉,
var $reg = new RegExp('[Nn]/[Aa]');
其他变化是:
/[Nn]/[Aa]/
'^[Nn]/[Aa]'
我建议:
stringToSearchIn.replace(/(N\/A)/gi,'words to replace with');
\/
/
gi
g
i
n
N
a
A
JS 小提琴演示
你可以只使用这个:
N\/A