<SNIP> subject =~ /\b(?!cartoon|croatan|carroon)c[arto]{5}n\b/i subject =~ /\b(?!downloadable)d[ownladb]{10}e\b/i subject =~ /\b(?!dripping)d[ripn]{6}g\b/i subject =~ /\b(?!ejaculating|enunciating)e[jacultin]{9}g\b/i
You can't use rules like this. The pattern "caaaaan" matches your first example. Similarly "drrrrrrg" matches the third line. I spent a while trying to work out the exact same problem, and the explanation that follows came to me while standing in the shower :) The mathematical explanation of why what you are considering is based on the fact that any regular expression can be expressed as a finite-state machine. One of the properties of finite-state machines is that they have no memory, (understanding of how they reached a specific state). What you are asking is 'can a finite-state machine support conditional movements' e.g go to state A if this is the first time it has seen an r, but go to state B if it is the second time. I hope this helps, feel free to drop me a line if you want a more detailed explanation/reasoning R --------------------------------------------------- This email from dns has been validated by dnsMSS Managed Email Security and is free from all known viruses. For further information contact [EMAIL PROTECTED]