Luca Scaljery <lcalje / gmail.com> wrote: > Hi All > > I just tried to test the content of a string, something like this: > > > c = "1234AA" > > if c.scan( /1234567890/ ) > p "OK" > else > p "NO" > end > > > This always returns "OK" :( > > Any suggestions what goes wrong here. And is this the way to check the > content of a string ? What exactly do you want to check? If you want to make sure that a string solely consists of digits this is what you would do: c = "1234AA" if /\A\d+\z/ =~ c puts "ok" else puts "nok" end Kind regards robert