hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,’’)
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
regards
caspar
On 8/30/06, Caspar Bl [email protected] wrote:
hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,‘’)
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
regards
caspar
|| (escape with )
On 8/30/06, Caspar Bl [email protected] wrote:
hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,‘’)
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
regards
caspar
params[:search_input].gsub!(/AND|OR|&&|||/, ‘’)
Blessings,
TwP
Caspar Bl wrote:
hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,’’)
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
Some characters have special meaning to the regular expression engine.
To
force them to be interpreted literally (as normal characters), escape
them,
like this:
params[:search_input].gsub!(/AND|OR|&&|||/,’’)