// find all the similar Regular expressions and return them. If $delete is true, delete them instead of returning them.
publicfunctionfind_similar($id,$delete=false){
$allRegexp=$this->find('all');
$original=null;
$finalArray=array();
// Let's find and read the original so we know what to look for:
foreach($allRegexpas$k=>$v){
if($v['Regexp']['id']==$id){
$original=$v;
}
}
// if we found the original, let's try to find all of the regexp values that match the original in the regexp and replacement fields.
// We should get a list of all the IDs (and their respective types) of regular expression entries that are duplicates created for various types.
// ip-src /127.0.0.1/ -> '' and ip-dst /127.0.0.1/ -> '' (entries that blacklists the ip-source and ip-destination addresses 127.0.0.1) will be returned when editing
// ip-src /127.0.0.1/ -> '', but other /127.0.0.1/ -> 'localhost' will not