From: Bart Braem Date: 2006-09-19T17:56:17+09:00 Subject: Re: Regular expression for string.anotherstring dblack@wobblini.net wrote: >> But is there a ruby operator to look for matches on the entire string? > > Do you mean scanning the string repeatedly? �If so, then you can use > String#scan. �If you mean anchoring a regex to the beginning of the > string, then you can use \A and \z (or \Z if you want to discount a > possible ending newline). I meant that I want to do input validation on the entire string. It must correspond to the format defined by the regular expression, no more, no less. That's why the newline part is not important here: I can't permit newlines. You are right about the ^ at the beginning, I will be using test =~ /\A\w+\.\w+\z/ Thanks a lot for the great input! Bart