Regex Until But Not Including

The explicit way of saying “search until X but not including X” is: (?:(?!X).)* where X can be any regular expression. In your case, though, this might be overkill – here the easiest way would be [^z]* This will match anything except z and therefore stop right before the next z. So .*?quick[^z]* will match … Read more