findall only works with a string as input not a list.

You probably want to use map and re.match or re.search for example:

Also your regex has multiple repeat symbols in it and needs some tuning, this one seems to work J\w{3}son

import re
a = ["Jackson", "Johnson", "Jason"]
c = list(map(lambda x: re.search("J\w{3}son",x), a))
print([i.string for i in c if i])

output:

['Jackson', 'Johnson']

Update if your input type is just a string then your original expression was fine you just need to change the regex to the example above

import re
a = "Jackson Johnson Jason"
b = re.findall("J\w{3}son", a)
print(b)

output:

['Jackson', 'Johnson']
Answer from Alexander on Stack Overflow
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ library โ€บ re.html
re โ€” Regular expression operations
4 days ago - Source code: Lib/re/ This module provides regular expression matching operations similar to those found in Perl. Both patterns and strings to be searched can be Unicode strings ( str) as well as 8-...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-regex-re-search-vs-re-findall
Python Regex: re.search() VS re.findall() - GeeksforGeeks
July 12, 2025 - Two commonly used functions are re.search(), which finds the first occurrence of a pattern in a string and re.findall(), which retrieves all matches of a pattern throughout the string.
Discussions

How to use Python regex pattern matching with re.findall(pattern, string)? - Stack Overflow
I need to match to the strings "Johnson" and "Jackson", but not the string "Jason." Using Python, I need to use the function findall in the RegEx library. I tried: a =... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python Regex and re.findall problems
In a string I want to find what we call โ€œmacrosโ€, but only some of them, and I want to find all macros that match: , or or . Hereโ€™s the code Iโ€™m using and the results. Iโ€™ve never doneโ€ฆ More on discuss.python.org
๐ŸŒ discuss.python.org
1
0
March 13, 2025
regex - How can I find all matches to a regular expression in Python? - Stack Overflow
When I use the re.search() function to find matches in a block of text, the program exits once it finds the first match in the block of text. How do I do this repeatedly where the program doesn't s... More on stackoverflow.com
๐ŸŒ stackoverflow.com
how to re.findall
re.findall(r'\D+,', code) Your regular expression here, \D+, means "find me a non-numeric digit, followed by at least one character of any type, followed by a comma" 'a, b' meets that - note, this is NOT ['a', 'b']. Nothing else meets it It's not that trivial to get ['a', 'b', 'c'] with a regex - if you don't HAVE to use a regex here, don't, there are much simpler ways If you MUST use a regex, something like this works >>> re.findall(r'(\D)(?:,|$)', code) ['a', 'b', 'c'] The regex here says "Find me a non-digit charater, followed by either ',' or the end of the string" The (?:...) thing means "don't include this group in the output You don't strictly need to use \D in this case, I assumed you had it in there for a reason. Depending on what you expect to be between the commas, other things will work also. More on reddit.com
๐ŸŒ r/learnpython
5
4
September 14, 2024
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_regex.asp
Python RegEx
A special sequence is a \ followed ... pair of square brackets [] with a special meaning: The findall() function returns a list containing all matches....
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python โ€บ regular expressions โ€บ re.findall()
Python | Regular Expressions | re.findall() | Codecademy
July 2, 2023 - The .findall() method iterates over a string to find a subset of characters that match a specified pattern. It will return a list of every pattern match that occurs in a given string.
๐ŸŒ
Python.org
discuss.python.org โ€บ python help
Python Regex and re.findall problems - Python Help - Discussions on Python.org
March 13, 2025 - In a string I want to find what we call โ€œmacrosโ€, but only some of them, and I want to find all macros that match: <rx;ABC123>, or <grf;ABC144> or <grfa;BDB199>. Hereโ€™s the code Iโ€™m using and the results. Iโ€™ve never doneโ€ฆ
Find elsewhere
๐ŸŒ
Google
developers.google.com โ€บ google for education โ€บ python โ€บ python regular expressions
Python Regular Expressions | Python Education | Google for Developers
The re.findall(pat, str) function finds all matches of a pattern in a string and returns them as a list of strings or tuples, depending on whether the pattern contains capturing groups.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ howto โ€บ regex.html
Regular Expression HOWTO โ€” Python 3.14.3 documentation
Author, A.M. Kuchling ,. Abstract: This document is an introductory tutorial to using regular expressions in Python with the re module. It provides a gentler introduction than th...
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ how to re.findall
r/learnpython on Reddit: how to re.findall
September 14, 2024 -

how to use re.findall so that it outputs from code = 'a, b, c' is ['a', 'b', 'c'] because a = re.findall([r'\D+,'], code) outputs ['a, b,']

๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ why does using the "?" in a regular expression with the "findall" method print out both the option group and the entire group?
r/learnpython on Reddit: Why does using the "?" in a regular expression with the "findall" method print out both the option group and the entire group?
January 23, 2021 -

I'm sorry if the way I phrased that question made absolutely no sense, but here is my code:

>>>> phoneRegex = re.compile(r'((\d\d\d-)?\d\d\d-\d\d\d\d)')
>>>> phoneRegex.findall("Hey, please feel free to call me at 123-555-1234, or if that doesn't work, call me on my cell at 123-123-1234")
[('123-555-1234', '123-'), ('123-123-1234', '123-')]

Essentially, I'm confused as to why the result of using the ".findall" method is a tuple. All I want the program to do is to find all instances of a phone number pattern where the area code portion (and the dash after that portion) is optional. The result should be a list of strings with just both phone numbers , no?

๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ re-findall-in-python
re.findall() in Python - GeeksforGeeks
July 23, 2025 - re.findall() method in Python helps us find all pattern occurrences in a string. It's like searching through a sentence to find every word that matches a specific rule. We can do this using regular expressions (regex) to create the pattern and ...
๐ŸŒ
Plain English
python.plainenglish.io โ€บ match-vs-search-vs-findall-python-regex-in-plain-english-6451dd69ec28
Match vs Search vs Findall โ€” Python Regex in Plain English | by Moh Haziane | Python in Plain English
July 9, 2025 - Their behavior in Python includes subtle constraints that arenโ€™t obvious from the English words alone. For instance, match() only checks the beginning of the string, whereas search() examines the entire string and stops at the first match it finds. Thatโ€™s not quite the same as how we usually search in real life, where we might expect to find everything weโ€™re looking for. In contrast, findall() aligns more closely with our expectations: it returns every occurrence.
๐ŸŒ
Python
bugs.python.org โ€บ issue35146
Issue 35146: Bad Regular Expression Broke re.findall() - Python tracker
November 2, 2018 - This issue tracker has been migrated to GitHub, and is currently read-only. For more information, see the GitHub FAQs in the Python's Developer Guide ยท This issue has been migrated to GitHub: https://github.com/python/cpython/issues/79327
๐ŸŒ
Python for Network Engineers
pyneng.readthedocs.io โ€บ en โ€บ latest โ€บ book โ€บ 15_module_re โ€บ findall.html
Findall function - Python for network engineers
An example of using findall in a log file parsing (parse_log_findall.py file): import re regex = (r'Host \S+ ' r'in vlan (\d+) ' r'is flapping between port ' r'(\S+) and port (\S+)') ports = set() with open('log.txt') as f: result = re.findall(regex, f.read()) for vlan, port1, port2 in result: ports.add(port1) ports.add(port2) print('Loop between ports {} in VLAN {}'.format(', '.join(ports), vlan))
๐ŸŒ
Real Python
realpython.com โ€บ regex-python-part-2
Regular Expressions: Regexes in Python (Part 2) โ€“ Real Python
June 16, 2023 - The re.search() call on line 10, in which the \d+ regex is explicitly anchored at the start and end of the search string, is functionally equivalent. `re.findall( Mark as Completed ยท Share ยท ๐Ÿ Python Tricks ๐Ÿ’Œ ยท Get a short & sweet Python Trick delivered to your inbox every couple of days.
๐ŸŒ
Xah Lee
xahlee.info โ€บ python โ€บ python_re.findall.html
Python: Regex re.findall
Return a list of all non-overlapping matches of regex in text. ... With Flags . import re print(re.findall(r'@+', 'what @@@do @@you @think')) # ['@@@', '@@', '@']
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-use-re-findall-in-python-to-find-all-matching-substrings-415132
How to use re.findall() in Python to find all matching substrings | LabEx
In this tutorial, we will explore Python's re.findall() function, a powerful tool for extracting matching substrings from text. This function is part of the built-in regular expression (regex) module in Python and is essential for text processing ...
๐ŸŒ
Quora
quora.com โ€บ What-is-the-difference-between-re-match-re-search-and-re-findall-methods-in-Python
What is the difference between re.match(), re. ...
Answer: re.match() re.match() function will search the regular expression pattern and return the first occurrence. It checks for a match only at the beginning of the string. So, if a match is found in the first line, it returns the match object.
๐ŸŒ
Board Infinity
boardinfinity.com โ€บ blog โ€บ a-quick-guide-to-regex-in-python
Regular Expressions in Python | Board Infinity
June 22, 2023 - In order to work with regular expressions, Python has a module called re. We must import the module in order to use it. To work with RegEx, the module defines a number of functions and constants which we will see one by one with the associated code. The table below highlights all the important regex rulesets. The list of strings that the re.findall() method returns contains all matches.