Python Regex to Find Sequences of One Uppercase Letter Followed by Lower Case Letters Last Updated : 08 Nov, 2025 Comments Improve Suggest changes 3 Likes Like Report Given a string containing a mix of uppercase and lowercase letters, the task is to extract all sequences where one uppercase letter is immediately followed by one or more lowercase letters using Regex in Python. For example:Input: geeAkAA55of55gee4ksabc3Ar2xOutput: ['Ak', 'Ar']Let’s explore different methods to check and extract such sequences efficiently in Python.Using re.finditer()The re.finditer() method finds all matches like re.findall(), but instead of returning a list, it yields match objects, which can be processed one by one. Python import re s = 'geeAkAA55of55gee4ksabc3Ar2x' for match in re.finditer(r'[A-Z][a-z]+', s): print(match.group()) OutputAk Ar Explanation:re.finditer(r'[A-Z][a-z]+', s) returns an iterator with all matches.Each match.group() retrieves the actual matched substring.Using re.findall()The re.findall() method directly extracts all sequences that match a given pattern and returns them as a list. Python import re s = 'geeAkAA55of55gee4ksabc3Ar2x' res = re.findall(r'[A-Z][a-z]+', s) print(res) Output['Ak', 'Ar'] Explanation:r'[A-Z][a-z]+' matches one uppercase letter followed by one or more lowercase letters.re.findall() scans the entire string and returns a list of all such substrings.Using re.findall() with Word BoundariesThis variation ensures that each valid sequence is treated as a standalone word by using word boundary anchors (\b). It’s especially useful when such patterns appear next to numbers or symbols. Python import re s = 'gee Ak AA55 of 55 gee4 ks abc3 Ar 2x' res = re.findall(r'\b[A-Z][a-z]+\b', s) print(res) Output['Ak', 'Ar'] Explanation:\b ensures that the match starts and ends at word boundaries.This ensures that only standalone capitalized words are matched, excluding patterns embedded within other words or digits. Create Quiz Comment S Smitha Dinesh Semwal Follow 3 Improve S Smitha Dinesh Semwal Follow 3 Improve Article Tags : Python Python Programs python-regex Python Regex-programs Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like