Use anchors: /^X+$/
In reply to Re: Check if a variable contains only one letter? by hdb in thread Check if a variable contains only one letter? by Anonymous Monk