diff --git a/wax-prosemirror-services/src/MathService/MathService.js b/wax-prosemirror-services/src/MathService/MathService.js
index 8584f727995bc348a6e8fb1d26e828f13d9a1bb1..3f3ca8ac72799e1142e276333096402ac4b59f8b 100644
--- a/wax-prosemirror-services/src/MathService/MathService.js
+++ b/wax-prosemirror-services/src/MathService/MathService.js
@@ -17,10 +17,7 @@ class MathService extends Service {
     const schema = this.container.get('Schema');
     const rules = this.container.get('Rules');
     const newRules = [
-      inlineInputRule(
-        /(?<!\\)\$(.+)(?<!\\)\$/,
-        schema.schema.nodes.math_inline,
-      ),
+      inlineInputRule(/(?!\\)\$(.+)(?!\\)\$/, schema.schema.nodes.math_inline),
       blockInputRule(/^\$\$\s+$/, schema.schema.nodes.math_display),
     ];
     // rules.addRule(newRules);
diff --git a/wax-prosemirror-services/src/RulesService/Rules.js b/wax-prosemirror-services/src/RulesService/Rules.js
index 107bbd0256ce6a7408c8097753c6ea9925585af5..466bf45fc459a320ec127683e8a4ea63d2ba75b4 100644
--- a/wax-prosemirror-services/src/RulesService/Rules.js
+++ b/wax-prosemirror-services/src/RulesService/Rules.js
@@ -55,7 +55,7 @@ class Rules {
         this.schema.nodes.heading,
         match => ({ level: match[1].length }),
       ),
-      inlineInputRule(/(?<!\\)\$(.+)(?<!\\)\$/, this.schema.nodes.math_inline),
+      inlineInputRule(/(?!\\)\$(.+)(?!\\)\$/, this.schema.nodes.math_inline),
       blockInputRule(/^\$\$\s+$/, this.schema.nodes.math_display),
     ];
   }