Snke Buhr wrote in post #1016662:
> Hi guys,
>
> I got
>
>     Net::SFTP.start("somehost", "someuser", :password => "somepwd",
> :keys => []) do |sftp|
>       sftp.dir.foreach("/upload/") do |e|
>
>
>
> What I want to do is to only parse the files in this given directory
> which include "findme" and "foundme" for example.
>
> ls -l | grep "findme\|foundme" does the trick in a normal console.
>
> Is there any way to do this via sftp?
>
> Thanks in advance.
>
> Regards


How about:

sftp.dir.foreach("/path/to/directory") do |entry|
  if entry =~ /(found|find)me/
    #do something here
  end
end