I need to convert string like \"/[\\w\\s]+/\" to regular expression.
\"/[\\w\\s]+/\" => /[\\w\\s]+/
I tried using different Regexp
Regexp
Using % notation:
%r{\w+}m => /\w+/m
or
regex_string = '\W+' %r[#{regex_string}]
From help:
%r[ ] Interpolated Regexp (flags can appear after the closing delimiter)