From: darren kirby Date: 2007-07-21T05:23:04+09:00 Subject: Re: Regexp question quoth the bcparanj@gmail.com: > I have a list of zip codes (3000). Is there any script that I could > use to create a regexp for checking if a user entered zip is in this > list or not? TIA. Doubtful you need a regexp. Answer depends on the format of your list. If it is a separate file with one code per line you could do: codes = IO.readlines("/path/to/codes").each { |line| line.chomp! } codes.include?(90210.to_s) or if you have ZIP + 4 codes: codes.include?("90210-1234") -d -- darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." - Dennis Ritchie and Ken Thompson, June 1972