http://qs321.pair.com?node_id=16377


in reply to Makeing rules in Regex for string content and size

A slightly shorter version of corion's nice explanation above would be:
 /^[\w ,"&-']{4,16}$/ Updated: Caveat - This will also allow underscores which is probably not what you want. Kudos to corion

Replies are listed 'Best First'.
RE: Re: Makeing rules in Regex for string content and size
by gaspodethewonderdog (Monk) on Jun 06, 2000 at 17:45 UTC
    then why not just do: /^A-Z0-9 ,"&-'{4,16}$/i in the first place
RE: Re: Makeing rules in Regex for string content and size
by gaspodethewonderdog (Monk) on Jun 06, 2000 at 17:46 UTC
    then why not just do: /^[A-Z0-9 ,"&\-']{4,16}$/i in the first place