For positive integers, $r\ge 3$, $h\ge 1$, and $k\ge 1$, Bollobás, Saito, and Wormald proved some sufficient conditions for an $h$‐edge‐connected $r$‐regular graph to have a $k$‐factor in 1985. Lu gave an upper bound for the third largest eigenvalue in a connected $r$‐regular graph to have a $k$‐factor in 2010. Gu found an upper bound for certain eigenvalues in an $h$‐edge‐connected $r$‐regular graph to have a $k$‐factor in 2014. For positive integers $a\le b$, an even (or odd) $\left[a,b\right]$‐factor of a graph $G$ is a spanning subgraph $H$ such that for each vertex $v\in V\left(G\right)$, ${d}_{H}\left(v\right)$ is even (or odd) and $a\le {d}_{H}\left(v\right)\le b$. In this paper, we prove upper bounds (in terms of $a,b,$ and $r$) for certain eigenvalues (in terms of $a,b,r,$ and $h$) in an $h$‐edge‐connected $r$‐regular graph $G$ to guarantee the existence of an even $\left[a,b\right]$‐factor or an odd $\left[a,b\right]$‐factor. This result extends the one of Bollbás, Saito, and Wormald, the one of Lu, and the one of Gu.