sed from start to match

C++
sed '/[match]/q' file.txt	
#Include q option at the end to grep untilmatch only
Source

Also in C++: