From: Daniel Finnie Date: 2006-12-21T05:50:11+09:00 Subject: Re: Regexp Question: Checking for [/joe] pairs The problem is that the Regexp is not anchored to the start and ends of the string. /^(?!\[joe\])*.?(\[joe\].+?\[\\joe\]){1,3}(?!\[joe\])*.?$/ Joe Peck wrote: > Daniel Finnie wrote: >> Why are you doing /[\s\d\w]+?/? Just use /.+?/. >> >> Dan > > Good point. I was using .+? earlier, but thought that might be part of > my problem. It seems to accept @x even if it contains more than 3 > [joe][/joe] pairs. >