Created
April 19, 2016 09:15
-
-
Save anonymous/b647cd091ab7d0a88a4fc14fc85e77b9 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
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