in reply to Identifying Files with Similar Names

F.e. you look for 6 letters, you can match a filename against
 /(^\w{6})(.*)/
than store $1 and match other filenames with it.
Now that I look at this, not an elegant solution, but it was the first thing that popped into my mind.