Вы можете заменить \b
на [\w-]
в вашем случае.
Кроме того, не совпадают границы.
И, наконец, не сопоставляйте промежуточные группы, составьте одну большую группу для своих матчей.
Демо
(?<![\w-])((?:adm-)?username\d?)(?![\w-])
[v] username
[v] username2
[v] adm-username
[v] adm-username2
[x] aadm-username
[x] aadm-username2
Объяснение
(?<![\w-]) # negative lookbehind, only match if no word character or hyphen is present
(
(?:adm-)? # non-matching group containing adm- literally once or none, will be matched in the greater group
username\d? # literally matching username and a digit, once or none
)
(?![\w-]) # negative lookahead, only match if no word character or hyphen is present