That makes it more difficult to match. But if these devices have a specific number of characters (or a specific character subset, like hex) that might make it a bit easier to create a specific regex to match this.
Otherwise you would likely have to resort to a regex like:
key.*
Which would match just about anytime the word key is seen in any config file, regardless of what comes after.