Suppose we need to match an input that contains three complete words, start, middle, and end, separated by non-whitespace characters.
Consider using the following pattern with a lazy quantifier:
startS+?middleS+?end
Instead of using the following pattern, our match will be faster if we use the preceding pattern:
startS+middleS+end