From: Peter Bailey Date: 2006-10-14T01:41:42+09:00 Subject: Regex parsing against filenames Hi, I need to match incoming filenames in a directory on my server, so that I can do stuff in a table. In my testing, I've got 9 files: pq181b1p.ps pq181b1t.ps pq181b2p.ps pq181b2t.ps pq181b3t.ps pq192b1p.ps pq192b1t.ps pq192b2t.ps pq192b3p.ps Only filenames 1,2,6 and 7 parse against the entry "dbfilename" in my database. The other 5 don't. The entries, for these files, in the database are "pq181b" and "pq192b." Shouldn't all 9 of these filenames parse true against "pq181b" and "pq192b??" Here's a snippet of my code, showing where I'm doing the regex. All the filenames are in the variable $psfile. ... db = KirbyBase.new { |d| d.path = "E:/workflows/graphics/pagecounts" } pageinfo_tbl = db.get_table(:pageinfo) result = pageinfo_tbl.select { |r| $psfile =~ Regexp.new(r.dbfilename) } ... Thanks, Peter -- Posted via http://www.ruby-forum.com/.