Posted by fourtyfreak on November 25, 2008 at 11:45am
Jump to:
| Project: | Search and Replace |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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
#1
If 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.
#2
Fantastic, thanks for your help, I was hoping it was that simple. :-)
Very useful module, cheers.
Paul
#3