to select everything up to the text "foo", the regular expression is
(.*) (foo)
When developing stuff, configuring systems, or simply working with computers, I come across obstacles that can be solved easily once you know the solution. But finding the solution can take ages. In this blog, I am collecting the solutions for some of the technical problems that I encounter.