/ Published in: Ruby
URL: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/233589
I just realized this kind of regex operation is done with slice in Ruby. In Perl that would be
print 'path/to/file' =~ m{(.*/)};
Expand |
Embed | Plain Text
puts $0.slice(/.*\//)
You need to login to post a comment.
