You should remove the ^/$ anchors, and you need no | inside the character class if you do not need to match a literal | with the regex:
\d_[a-zA-Z]+_test
See regex demo
The ^ is a start of string anchor, and $ is an end of string anchor, thus, they "anchor" the string you match at its start and end.
As for |, a character class matches a single character. [a-zA-Z] matches 1 letter. No need in the alternation operator | here since it is treated literally (i.e. the [a-zA-Z|] will match | symbol in the input string).
Just FYI: in many cases, when you need something to be matched inside a larger string, you need to use word boundaries \b to match whole words:
\b\d_[a-zA-Z]+_test\b
However, people often have non-word characters in patterns, then you'd be safer with look-arounds (not sure your engine supports look-behind, but here is a version for, say, PCRE):
(?<!\w)\d_[a-zA-Z]+_test(?!\w)
^and$, and|.\b\d_[a-zA-Z]+_test\b