You can also use strip() if it's the same possibilities every time: line_of_text.lstrip('<values') That's a lot faster than regex.