Is there a way to use the rails method matchwith a simple string and not with a regular expression? I am trying to map url as such
sometext.match('http://www.example.com')
The problem is that this evaluates to a regular expression, so I need to avoid all special characters to work correctly:
sometext.match('http:\/\/www.example\.com\?foo=bar')
If there is no way to match only strings, is there a way to automatically avoid it for regular expressions?
Thank!
source
share