Created
October 4, 2010 22:03
-
-
Save azizshamim/610539 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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