Trying to find instances of "N/A" in markup and swap out with something else,
var $reg = new RegExp('[Nn]/[Aa]');
other variations were:
/[Nn]/[Aa]/
'^[Nn]/[Aa]'
I'd suggest:
stringToSearchIn.replace(/(N\/A)/gi,'words to replace with');
\\/
escapes the slash, as the /
character delimits the regex string, and gi
at the end:
g
is for a global search, so it doesn't stop after the first match, and i
is case-insensitive (so it'll match n
and N
, a
and A
. 你可以使用这个:
N\/A
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.