Three reasons why your pattern won't match ever:
- [...] matches a single character but you expect it to match more than that.
- Your don't match newlines anywhere, but there are clearly some present between "#bg" and "#end".
- No item of the grepped list contains both "#bg" and "#end".