Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regex switching problem

by jackdied (Monk)
on Oct 20, 2001 at 02:00 UTC ( #120165=note: print w/replies, xml ) Need Help??


in reply to Regex switching problem

Updated, how bout this

my @out = split(/\s+(AND|OR)\s+/i, $string); for (my $i = 0; $i < scalar(@out); $i += 2) { $out[$i] = 'tools.description LIKE "%' . $out[$i] . '%"'; #NB, you w +ant to quote $out[$i] appropriately for your database to avoid arbitr +ary user SQL uc($out[$i+1]); } print join(' ', @out);
-jackdied

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://120165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-08-09 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?