Hello all

I have written a script to search the current directories and grab the
file path for a set of filtered files. Example of what it returns:
c:/Documents and
Settings/Administrator/Desktop/version3/test_files/apserver1.int-APACHE.gz
c:/Documents and
Settings/Administrator/Desktop/version3/test_files/apserver2.int-APACHE.gz
c:/Documents and
Settings/Administrator/Desktop/version3/test_files/apserver3.int-APACHE.gz

What I am trying to do is extract only the server names. So apserver1,
apserver2 and apserver3. I need a regular expression that will grab
everything after the last forward slash and then the text before the
first "."  So far I can only get it grab everything after the first
forward slash. So far I have:

apache_server_filter.each do |x|
      puts x.to_s.scan(/(\/\D+)/)
end

This pulls out: /Documents and Settings/Administrator/Desktop/version
/test_files/ap

Does anyone have any ideas?

Thanks :)

-- 
Posted via http://www.ruby-forum.com/.