Using Regular Expressions to validate a fixed length numerical string.
a = '547' /^\d\d\d$/ ~= a
DZone Snippets > jrobertson > fixed
11381 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
James Robertson http://www.r0bertson.co.uk
a = '547' /^\d\d\d$/ ~= a