Regex to Match Letters Only
Copy the pattern, paste your words, and see which contain only letters. Below: how to include spaces or Unicode letters.
/
/
What this pattern matches
It matches a whole string of ASCII letters only — no digits, spaces, hyphens, or symbols.
Part by part
^[A-Za-z]+$ — anchored start to end, one or more letters.
Common variations
Allow spaces (names): ^[A-Za-z ]+$. Allow hyphens and apostrophes: ^[A-Za-z'\-]+$. Unicode letters: ^\p{L}+$ in PCRE.
Use it in your code
Python
import re
text = "Hello\nWorld123\nabc\nJean-Luc\nOK"
pattern = r'''^[A-Za-z]+$'''
for m in re.finditer(pattern, text, re.M):
print(m.group())
JavaScript
const text = "Hello\nWorld123\nabc\nJean-Luc\nOK";
const re = new RegExp(String.raw`^[A-Za-z]+$`, "gm");
console.log(text.match(re));
FAQ
Why does 'Jean-Luc' fail?
The hyphen is not a letter. Add it to the class: ^[A-Za-z\-]+$.
How do I match full names with spaces?
Use ^[A-Za-z ]+$, but note this also allows leading and trailing spaces.
Does it handle non-English letters?
No. [A-Za-z] is ASCII. Use \p{L} (PCRE) or re.UNICODE with [^\W\d_] in Python.