Skip to content

Instantly share code, notes, and snippets.

@danlynn
Created July 13, 2012 13:12
Show Gist options
  • Save danlynn/3104818 to your computer and use it in GitHub Desktop.
Save danlynn/3104818 to your computer and use it in GitHub Desktop.
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"]]
@countdigi
Copy link

interesting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment