Created
August 14, 2014 18:54
-
-
Save coderek/3093b65b00d3182788cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| _, seq = STDIN.read.scan(/(\n>THREE[^\n]*\n)([^>]*)\n/).flatten | |
| p _, seq | |
| # you can run this file as `ruby scan.rb < test`, where test contains the text to match | |
| # it matches something like this, note the new line at beginning | |
| # | |
| # >THREE zengqiang | |
| # xiaoni | |
| # | |
| # output | |
| # "\n>THREE zengqiang\n" | |
| # "xiaoni" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment