#!/bin/bash
s='hi helo tmp#100000 bye
100000 hi bye
hi 100000 bye'
var=100000
grep -E "(^|[[:blank:]])$var($|[[:blank:]])" <<< "$s"