Regexs in Ruby getting filename
- by user1290757
i am extracting file names of html files using line:
filename = File.basename(input_filename, ".*")
which currently prints full file name excluding .html extension
All files are stored in the form of http^x.x.edu^1^2 all file names begin with http^ and contain edu^ what i want is to extract 2 (which changes) but it is always the second element after .edu I have attempted destructive gsub! but i m weak with regular expressions.