in reply to Re^2: Regex Question
in thread Regex Question

Less scalable, as you cannot add regexes to @badwords ;)

Replies are listed 'Best First'.
Re^4: Regex Question
by ikegami (Patriarch) on Jul 12, 2006 at 23:56 UTC
    @badwords can't contain both regexps and words. For example, your solution will fail with words (e.g. f*ck won't work), mine will fail with regexps (e.g. f[u*]ck won't work). I assumed you wanted words since your called your array @badwords.

    Both solutions are fine (although the name @badwords is a bit misleading if it contains regexps) depending on what is needed.