My regex is matching too much. How do I make it stop? [duplicate] Make .* non-greedy by adding ‘?‘ after it: Project name:\s+(.*?)\s+J[0-9]{7}: