18 May 2020, 17:13
We're taking advantage of the fact that RegExReplace will replace all instances (unlike RegExMatch, which only finds one instance at a time), so we can use it to find all instances in one command. Then the need is to replace everything in the string but the piece of interest, so we need to match everything then reference the piece of interest in the replacement string.
The parenthesis identify a subpattern which we can include in the replacement string by identifying it as $1 (for the first one, subsequent ones would have been $2, $3, etc., but we only have one). We need to match everything so it's replaced only by our identified subpattern, thus the need to match everything leading up to it with .*?model: (the .*? matches everything leading up to it in a non-greedy manner) as well as everything after it, which includes all the "device" and "transport" stuff including the "wildcards" to make it match the changing parts. So when you replace everything with just the subpattern ($1) and a linefeed character (`n), you're left with just the stuff you want on separate lines.