The rules for using a regexp that includes backslashes inside the test construct are arcane so it's usually clearer/simpler to define the whole regexp in a variable and then compare against that, e.g.:
$ A='enp1s0 enp2s0 enp3s0 enp4s0 lo tailscale0'
$ B='enp1s'
$ re="\\<$B\\>"
$ [[ $A =~ $re ]] && echo yes
$ B='enp1s0'
$ re="\\<$B\\>"
$ [[ $A =~ $re ]] && echo yes
yes
Be aware , though, that those \\< and \\> constructs are word boundaries so if B happens to be part of a substring of A that contains non-word-constituent characters, e.g.:
$ A='enp1s0-3 enp2s0 enp3s0 enp4s0 lo tailscale0'
then the above will produce a false match:
$ B='enp1s0'
$ re="\\<$B\\>"
$ [[ $A =~ $re ]] && echo yes
yes
and so you need to use something like this instead to specifically test for spaces around B:
$ B='enp1s0'
$ re="(^|\\s)$B(\\s|$)"
$ [[ $A =~ $re ]] && echo yes
$ B='enp1s0-3'
$ re="(^|\\s)$B(\\s|$)"
$ [[ $A =~ $re ]] && echo yes
yes
Also be aware that the above is doing regexp matching so any regexp metachars in your B string such as . or * will be treated as such, not as literal characters, so if you're trying to match a literal substring that just happens to contain regexp metacharacters then you could end up with false matches, e.g.:
$ B='en.*0'
$ re="\\<$B\\>"
$ [[ $A =~ $re ]] && echo yes
yes
For a literal substring match, assuming the white space in A is blank chars, use [[ " $A " == *" $B "* ]] instead, e.g.:
Incomplete substring does not match:
$ B='enp1s'
$ [[ " $A " == *" $B "* ]] && echo yes
Substring containing the "match any character" globbing metachar does not match:
$ B='enp1s?'
$ [[ " $A " == *" $B "* ]] && echo yes
Substring containing the "match any character" regexp metachar does not match:
$ B='enp1s.'
$ [[ " $A " == *" $B "* ]] && echo yes
Substring which is a complete "word" matches:
$ B='enp1s0'
$ [[ " $A " == *" $B "* ]] && echo yes
yes