In future, please create a new thread for each question. This makes it easier for others with the same problem to search for the answer. Thank you for your cooperation!
To answer your question, you’ll need to match your code in the regex as well.
As your code is four characters/alphabets long, that’s (?<code>[a-z0-9]{4}).
Also, using [.*] is wrong, because anything in the square brackets is a literal character. So you’ll only be matching a single character that is either a . or * character, which wouldn’t exist. You’d likely want .*? instead.
To put it together with what you currently have,
Your Security code for User Agent: .*? is: (?<code>[a-z0-9]{4})