Reputation: 315
For code
url.gsub(/"|\[|]| /, '')
ruby raises warning
warning: regular expression has ']' without escape: /"|\[|]| /
How to fix it?
Upvotes: 1
Views: 213
Reputation: 174706
Your regex would be reduced to,
url.gsub(/[ "\[\]]/, '')