On Wed, 23 May 2001, Kyrytow, Stefan wrote: > As you can see the last two inputs should not be accepted. I am using $x =~ > /[0-9]/ as my filter. I understand why the values are being accepted, I am > searching for a number and 12bob & bob12 each contain a number. > > What I do not understand is how to search for just a number. The problem is that your regexp is matching *any* string that contains the pattern. You want to narrow your expression down a bit. Try: $x =~ /^\d+$/. -- Brett
- Regular Expressions Kyrytow, Stefan
- Re: Regular Expressions Brett W. McCoy
- Re: Regular Expressions Jos Boumans
- Re: Regular Expressions Jeff Pinyan
- Re: Regular Expressions Randal L. Schwartz
- Re: Regular Expressions Jeff Pinyan
- Re: Regular Expressions Jeff Pinyan
- Re: Regular Expressions Timothy Kimball
- regular expressions Salvador Lopez
- Re: regular expressions Akshay Arora
- Re: regular expressions Dan Grossman