Yes, but why ?
In my case I really need to validate the full content of line.

expect(chef_run).to create_file_with_content 'hello-world.txt', /^hello world, your are in the (\d+) day of the year$/

For example :)