次の正規表現は間違っています - 誰かがすべてを見つけるのを手伝ってくれませんか? 私は以前にそのような正規表現を必要としませんでした。境界という言葉は物事を混乱させるかもしれません。
ありがとう
<script type="text/javascript">
function regexTest(string, assert) {
document.write('<hr>')
document.write(string)
document.write("[")
document.write(string.match(/\b((?!please ignore me )\:\-\))\b/gi)!=null);
document.write("]?" + assert);
}
regexTest("1. this is the first string :-) ",true);
regexTest("2. :-)",true)
regexTest("3. another string:-)here",true);
regexTest("4. Ending a sentence with :-)",true);
regexTest("5. please ignore me :-)",false);
</script>