diff --git a/pd/nw/index.js b/pd/nw/index.js
index 1cd5e01f1466ab118b585283984b054d4189c4a7..8417d022c5fb14b405d11c7a3c9496ea474ef429 100644
--- a/pd/nw/index.js
+++ b/pd/nw/index.js
@@ -117,7 +117,7 @@ function console_unwrap_tag(console_elem, tag_name) {
 // We need to use a regular expression to search without regard to case
 function escapeRegExp(string){
   // $& means the whole matched string
-  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+  return string.replace(/[.*+?^${}()|\[\]\\]/g, "\\$&");
 }
 function console_find_text(evt, callback) {
     var console_text = document.getElementById("p1"),