I think this will be useful to someone. By extension, if you want to match a specific string within a line that is no longer than say 255 characters, this would be a solution.
Usage: looking for a string but wanting to exclude long lines like minified JS files which you didn't write or don't need
grep -x '.\{1,255\}theStringIWant.\{1,255\}'
A bit of a hack as you can't really control the length on both ends to be no more than a certain number (it could be 1 and 255, 255 and 1, or 255 and 255) but this works in most cases to exclude minified long lines
BASH NEWBIE TIP: the \
backslashes are escape characters for the {}
braces.
Example/Proof:
echo "aaaalocalStoragebbbbccccdd" | grep -x '.\{3,10\}localStorage.\{3,10\}' #works
echo "aaaalocalStoragebbbbccccdddd" | grep -x '.\{3,10\}localStorage.\{3,10\}' #doesn't work, dddd puts end string to 12 chars
grep -x '.\{3,10\}'