Created
April 19, 2016 09:15
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
name_regex = / | |
\s+ | |
(?<evs>\S+) | |
\s+ | |
(?<mode>(ADS|NT4)) | |
\s+ | |
(?<status>\S+) | |
\s+ | |
(?<domain>\S+) | |
\s+ | |
(?<name>\S+) | |
/x | |
name_list = "Configured names. | |
evs mode status domain serving name | |
1 NT4 online DOMAIN1 machine123 | |
1 NT4 online DOMAIN1 machine2-3-4 | |
1 ADS online DOMAIN1 machine-machine | |
" | |
@extracted_names = name_list.scan(name_regex) | |
puts @extracted_names[0][:name] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment