Created
July 13, 2012 13:12
-
-
Save danlynn/3104818 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
1.9.2p320 :001 > s = "test: string with @ref and @ref2 in it" | |
=> "test: string with @ref and @ref2 in it" | |
1.9.2p320 :002 > s.scan(/(?<=@)\w+/) | |
=> ["ref", "ref2"] | |
1.9.2p320 :003 > s.scan(/@(\w+)/) | |
=> [["ref"], ["ref2"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
interesting