Stefan Kyrytow 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. Nail the regex down to match at the beginning and end of the input string: /^[0-9]+$/ or, equivalently, /^\d+$/ ^ matches the beginning of the string $ matches the end fo the string If the string contains anything but digits, the match will fail. -- tdk
- 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 Expression... 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
- Re: regular expressions Jeff 'japhy/Marillion' Pinyan
- Re: regular expressions Jos I. Boumans
- RE: regular expressions Wagner-David
- RE: regular expressions PURMONEN, Joni
- RE: regular expressions Rashid Faraby
- Regular Expressions Adimoolam Narayanan