Closed (fixed)
Project:
Search and Replace
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Nov 2008 at 11:45 UTC
Updated:
2 Dec 2008 at 19:30 UTC
Hi,
Is there any way to do a search and replace on less than 3 characters? A recent change of database left me with rogue characters in my text which I need to replace with the correct ones. Most of the rogue strings are 3 characters long, so are no problem, but somer are single digits which need deleting.
if I replace the 3 with 1 will it mess with the function of the module? or is the 3 char limit there for another reason?
function search_and_replace_settings_submit($form_id, $form_values) {
if(strlen($form_values["search_term"]) < 3){
form_set_error("search_term","You can't do a replace of a string less then 3 in length.");
return false;
}Cheers
Paul
Comments
Comment #1
btopro commentedIf you replace that 3 with a 1 you will be able to do searches of 1 and 2 characters. The reason I put this in is that this can take an extremely long time. If you need to search for smaller items though you've found the line to alter.
Comment #2
fourtyfreak commentedFantastic, thanks for your help, I was hoping it was that simple. :-)
Very useful module, cheers.
Paul
Comment #3
btopro commented