It's possible to combine all of the above into expressive ranges:
:1267,/foo/-2command :'{,command :'f,$command
Be creative and don't forget to read :help cmdline-ranges.
:help cmdline-ranges