Here's the regex that will match everything from the pattern until a newline is found.
Say you want to remove everything after "here" from this sample file.
code here where?
code here right here!
code here look every where.
Used regex
s/here.*//
Explanation:
.*
dot matches any character including spaces, numbers, alphabets but not new line.
asterisk matches any number of occurrences of a character
s/here.*/meow/ will result in
code meow
code meow
code meow