Page 1 of 1

Need help with simple regex

Posted: Sun Nov 25, 2007 9:42 am
by sharstine
Hello,

I'm running Unreal3.2.7. I know how to use the /spamfilter commands, but I'm not very familiar with regex.

Could someone please tell me how I could ban a single word (including spaces, underscores, and other characters between the letters)?

For example, if the word I need blocked is "snickers", then the regex would need to detect all these variations:

snickers
s n i c k e r s
s/n/i/c/k/e/r/s
s_n_i_c_k_e_r_s
s_____n__i_-c-___k__e__r----s
s___n___i___c___k___e___r___s
s....n..i......c..k..e...r........s

Any suggestions?

Re: Need help with simple regex

Posted: Sun Nov 25, 2007 7:52 pm
by sharstine
Nevermind... I received help from the #unreal-support room this morning.

In case anyone has the same problem, the solution was: s.*n.*i.*c.*k.*e.*r.*s

Re: Need help with simple regex

Posted: Mon Nov 26, 2007 2:55 am
by sharstine
Although this worked, another user happened to type a really long string that included the blocked text.

Here's what I need:

How would I go about using s.*n.*i.*c.*k.*e.*r.*s, except the characters between each letter would be limited to 5?

For example: S (random character) (random character) (random character) (random character) (random character) N (random character) (random character) (random character) (random character) (random character) I (random character) (random character) (random character) (random character) (random character) C (random character) (random character) (random character) random character) (random character) K (random character) (random character) (random character) (random character) (random character) E (random character) (random character) (random character) (random character) random character) R (random character) random character) (random character) (random character) (random character) S

Any suggestions please?

Re: Need help with simple regex

Posted: Mon Nov 26, 2007 8:57 am
by Jobe
Replace the ".*"'s with ".{0,5}"