I am trying to use a regular expression to find a part of a string and select everything up to that string. So for example if my string is "if (a = 6 && b = 8)