in reply to Regex Problem

The opposite of "A non-word character" (/\W/) is "No non-word characters" (!/\W/) or "all word characters" (/^\w*\z/). That's why /\w/ didn't work.