Michael Holzt wrote: >> The trick is to use anchors: /\A \d+ \z/. > > Whats \A and \z? Wouldn't be /^\d+$/ sufficient?
Aha, someone who has yet to read PBP! [1] \A start of string \z end of string Also, Conway recommends always using the /x /m /s flags, so the above regex would be: /\A \d+ \z/xms I unreservedly recommend this book. R. [1] http://www.oreilly.com/catalog/perlbp/
