[thelist] regex help

Matt Warden mwarden at gmail.com
Thu Aug 24 17:17:26 CDT 2006


On 8/24/06, Anthony Baratta <anthony at baratta.com> wrote:
> Try this...
>
> ^\d{5}$

Just to explain why this works and yours doesn't...

\d{5} says match 5 digits.

Can you find 5 consecutive digits in "1234567890"? Yes.

^\d{5}$ says match the  beginning of the string, 5 digits, then the
end of th string. Thus, it would not match the above string.

-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list