Skip to content

Instantly share code, notes, and snippets.

@azizshamim
Created October 4, 2010 22:03
Show Gist options
  • Save azizshamim/610539 to your computer and use it in GitHub Desktop.
Save azizshamim/610539 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# RUBY
string = "welcome is the new welcome!"
regex = Regexp.new(/welcome!?/)
puts "In ruby the index of the match is: "+string.index(regex).to_s
$ In ruby the index of the match is: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment