Those items are part of a regular expression.
The "." represents any character except the newline character.
The "*" tells the compiling to look for zero or more of the character just previous to the "*".
So, the regex says "Look for zero or more of any character until you get to NAS".
The "\d" represents any digit (0-9). The "{1,2}" tells the compiling to look for a minimun of 1, maximum of two of the character just previous.
So, the regex says "Look for 1 or 2 digits".
All together: "Look for zero or more of any character, followed by NAS, followed by 1 or two of any digit."
The $ sign indicates that the end of the string. So, it is stipulating that the 1 or 2 digits have to be the very last item in the string or else it won't match.
The parentheses around NAS\d{1,2} tell the compiler that you want to save the results of what is found in parentheses. The found results are stored in a special variable. The variable for one set of parentheses is $1. If you had two sets, it would be $1, $2. Each additional set of parentheses adds one to the number in the special variable.
You can find out more about regular expressions here: