Replace Words
Replace Words
Ok i've found a way to replace words not only bad words but all the words that i would like to replace.
I've created a file called wordreplace.conf and included it in the unrealircd.conf
include "wordreplace.conf";
Where in the wordreplace.conf are this commands:
badword channel {
word ^(a);
replace A;
};
This one replac the first letter (a) at the beginning with the big (A)
Example:
User wrote: | 15:29:41 | <nickname> amin my bro
Other users see this: | 15:29:41 | <nickname> Amin my bro
badword channel {
word (aaa*);
replace aaa;
};
And here User wrote: | 15:29:41 | <nickname> aaaaaaaaaaaaaaa
Other users see this: | 15:29:41 | <nickname> aaa
Or here User wrote: | 15:37:17 | <nickname> jaaaaaaaaaaaaaaa
Other users see this: | 15:37:17 | <nickname> Jaaa
I would like to replace also the characters ??? !!! --- *** tu replace it shourter, but it tells me: badword::word contains an invalid regex: Regular expression is too broad.
I dont have any problems here it works well for me with the first and second one. The point is i would like to add more thinks like: Replace all caps, replace only a word etc. with a simple regex not adding all of them on by on. It takes alote of time and work.
I know this is not the right place to ask about badword, its only for spamfilter, but you guys helped me alote with spamfilter, so i though its better to post my request here.
And is there also a special documentation with regex for badword like the one for spamfilter?
Thank you very much in advance!!!
I've created a file called wordreplace.conf and included it in the unrealircd.conf
include "wordreplace.conf";
Where in the wordreplace.conf are this commands:
badword channel {
word ^(a);
replace A;
};
This one replac the first letter (a) at the beginning with the big (A)
Example:
User wrote: | 15:29:41 | <nickname> amin my bro
Other users see this: | 15:29:41 | <nickname> Amin my bro
badword channel {
word (aaa*);
replace aaa;
};
And here User wrote: | 15:29:41 | <nickname> aaaaaaaaaaaaaaa
Other users see this: | 15:29:41 | <nickname> aaa
Or here User wrote: | 15:37:17 | <nickname> jaaaaaaaaaaaaaaa
Other users see this: | 15:37:17 | <nickname> Jaaa
I would like to replace also the characters ??? !!! --- *** tu replace it shourter, but it tells me: badword::word contains an invalid regex: Regular expression is too broad.
I dont have any problems here it works well for me with the first and second one. The point is i would like to add more thinks like: Replace all caps, replace only a word etc. with a simple regex not adding all of them on by on. It takes alote of time and work.
I know this is not the right place to ask about badword, its only for spamfilter, but you guys helped me alote with spamfilter, so i though its better to post my request here.
And is there also a special documentation with regex for badword like the one for spamfilter?
Thank you very much in advance!!!
Thx Jason
Thank you Jason now it works good
I got one more question. Are the regex from spamfilter the same as for badword? And if not, does exsist a documentetion for badword like the one for spamfilter?
But, if the regex are the same can i use this one to replace 100% Caps with small letters.
Where this one in spamfilter blocks the text in caps with spaces more than 25 char..
(?-i)[A-Z ]{25}
Can i use this one in badword to replace f.ex.
badword channel {
word (?-i)[A-Z ]{25};
replace (?-i)[a-z ]{25};
};
this one doesnt work it will reply the (?-i)[a-z ]{25} text ever time some on writes with caps.
I think it would be a good idea to open a new Post for badword or to make a documentation like the spamfilter doc.
Thank you all here in UnrealiRCD Forum!!!
I got one more question. Are the regex from spamfilter the same as for badword? And if not, does exsist a documentetion for badword like the one for spamfilter?
But, if the regex are the same can i use this one to replace 100% Caps with small letters.
Where this one in spamfilter blocks the text in caps with spaces more than 25 char..
(?-i)[A-Z ]{25}
Can i use this one in badword to replace f.ex.
badword channel {
word (?-i)[A-Z ]{25};
replace (?-i)[a-z ]{25};
};
this one doesnt work it will reply the (?-i)[a-z ]{25} text ever time some on writes with caps.
I think it would be a good idea to open a new Post for badword or to make a documentation like the spamfilter doc.
Thank you all here in UnrealiRCD Forum!!!
Yes but it doent work like i though because the target replace is not working with the regex. I mean even if i would put a regex on WORD (?-i)[A-Z ]{25} for caps and put at REPLACE like (?-i)[a-z ]{25} it will reply only the regex (?-i)[a-z ]{25} when users write in caps. It will not reply on small letters.
I though it would work like this, but i think i will replace only some words without regex. Like WORD Shit replace Shoot
I though it would work like this, but i think i will replace only some words without regex. Like WORD Shit replace Shoot
Yup
Yeah, Unfortunately it is true.aquanight wrote:Replace is literal text. It's not a regex, and it doesn't do capture substitution.
Can you plz give me the link of spamfilter explenation for the commands to lern more about how to use spamfilter regex. I know there is or was such a documentation, but i cant find it any more. Thx
-
- Posts: 53
- Joined: Thu Apr 06, 2006 3:35 pm
- Location: Turkey
- Contact:
Re: Thx Jason
hello guest,Guest wrote:Thank you Jason now it works good
can paste your replace words block to here, I want it thnx
I use ;
badword channel {
word (aaa*);
replace aa;
};
badword channel {
word (bbb*);
replace bb;
};
badword channel {
word (ccc*);
replace cc;
};
badword channel {
word (ddd*);
replace dd;
};
badword channel {
word (eee*);
replace ee;
};
badword channel {
word (fff*);
replace f;
};
......
for all charecter add all charecter