Skip to content

Commit 672fc73

Browse files
author
webdev778
committed
Correctly escape Regexp strings to avoid warnings
1 parent 2fc6b85 commit 672fc73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/interscript/compiler/python.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def escape(val)
2323

2424
def re_escape(val)
2525
@pycall_regex ||= PyCall.import_module("regex")
26-
@pycall_regex.escape(val)
26+
@pycall_regex.escape(val).gsub("\\", "\\\\\\\\").gsub('"', "\\\\\"")
2727
end
2828

2929
def new_regexp(str)

0 commit comments

Comments
 (0)