Skip to content

Commit

Permalink
More character classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Mar 28, 2018
1 parent 0d7d997 commit 370520a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/helpers/search_helper.rb
Expand Up @@ -12,7 +12,11 @@ def self.parse_search_params(params, symbol, user_signed_in)
end
regex_support = {
'\w' => '[a-zA-Z0-9_]',
'\W' => '[^a-zA-Z0-9_]'
'\W' => '[^a-zA-Z0-9_]',
'\s' => '[\r\n\t\f\v ]',
'\S' => '[^\r\n\t\f\v ]',
'\d' => '[0-9]',
'\D' => '[^0-9]'
}
regex_support.each { |k, v| input = input.gsub(k, v) }
else
Expand Down

0 comments on commit 370520a

Please sign in to comment.