Need help with simple regex

These are old archives. They are kept for historic purposes only.
Post Reply
sharstine
Posts: 12
Joined: Sun Nov 13, 2005 2:38 pm

Need help with simple regex

Post 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?
sharstine
Posts: 12
Joined: Sun Nov 13, 2005 2:38 pm

Re: Need help with simple regex

Post 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
sharstine
Posts: 12
Joined: Sun Nov 13, 2005 2:38 pm

Re: Need help with simple regex

Post 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?
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Need help with simple regex

Post by Jobe »

Replace the ".*"'s with ".{0,5}"
Your IP: Image
Your Country: Image
Post Reply