Formatting
Separate command execution check from main logic
Extract loop building the response
Extract method for building the original string tokens
Extract the execution of the shell command
Extract guard clause to method
Rename method clarifying intent
Extract building the response logic
Extract command object to build response
Move BuildResponse into separate file
Move requires to top of file
Formatting
Move regex constant to the class it's used
Make system command syntax easier to read
Rename variable to better represent content
Extract method
Extract method for extracting results
Formatting
Extract predicate into method

This requires an investigation into why the word is being compared to the regex.
Extract predicate into method

This is required reversing the 'if' statement to work with the positive predicate.