ah, ok.. and it seems I misread your original problem, as you seem to want to allow line terminators..
If I am not mistaken, you cannot have grep do that for you, since grep seems to always process it's input as line-by-line (somebody correct me if some variant of grep allows multiline matches). Depending what you want to do, you might be able to use 'sed' though (or if everything else fails, perl if ofcourse your friend
)
To match those patterns within one line, you can use simply
or whatever...