Hi all I tried to create some regex
with random value.
var data = "demo purpose?"; **OR** var data = "demo purpose";
var sentence = "can I put these app as demo purpose?";
var re = new RegExp("\b(" + data + ")\b", "g");
console.log(sentence.match(re)); // output ["demo purpose"]
In variable data
have two different value demo purpose?
& demo purpose
with only question mark. Both console out are same please any one Give me hint what should i do in these case.
-
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…