Skip to content
Tech terms

How to pronounce regex

Regex is usually pronounced REG-eks, with a hard g as in regular. A soft-g version, REJ-eks, is also heard.

regex

IPA
/ˈrɛɡɛks/
Say it like
REG-eks
REGeks
The controls above compare IPA spellings. Reference recordings are below.

Same in the US and UK, stressed on the first syllable. US dictionaries write /ɛ/, UK ones /e/, for the same vowel. Soft-g /ˈrɛdʒɛks/ is heard in both.

Listen and compare

Compare a reference reading, a direct machine reading, and a contextual sentence. These are not separate US and UK recordings.

Reference reading

regg ex

Reference reading0:00 / Listen

Direct machine reading

regex

Direct machine reading0:00 / Listen

In a sentence

这个字段用正则 regex 校验。

In a sentence0:00 / Listen
COMMON MISTAKES

How people get regex wrong

Often heard

REE-jeks

Treating re as the prefix in redo and using a long ee. The re comes from regular, so the vowel is the short e of red.

SayREG-eks

Often heard

reg-EKS

Stressing ex as if it were a separate word. Like FedEx, regex is stressed on the first syllable: REG-eks.

SayREG-eks

IN A SENTENCE

Hear regex in a sentence

  1. I wrote a regex to check that every email address has an @ sign.

  2. Test your regex on real data before you ship it.

  3. Most programming languages, including Python and JavaScript, support regex.

PRACTICE

Record yourself and compare

Tap record, say regex once, and compare the rhythm of your waveform with the reference. Your recording stays in your browser and is never uploaded.

Reference
Yours
MEANING

What does regex mean?

Regex is short for regular expression, also written regexp. A regex is a compact pattern that describes text. Programmers use regexes to search, match, validate and replace strings: checking that an email address looks valid, pulling dates out of a log file, or renaming hundreds of files at once.

The word blends the first syllables of regular and expression. Regular expressions grew out of mathematician Stephen Kleene's work on regular languages in the 1950s, were adopted by Unix tools such as grep and sed, and became central to the Perl language. Today nearly every major programming language supports them.

The pronunciation debate comes from spelling. In English, g before e is often soft, as in gel or register, which suggests REJ-eks. But the g comes from regular, which has a hard g. Jeffrey Friedl, author of Mastering Regular Expressions, says it with a hard g so that it rhymes with FedEx.

FAQ

regex pronunciation FAQ

The questions people ask most when they look up regex.

Is regex pronounced with a hard g or a soft g?+

Both are used. The hard-g REG-eks is the more widespread choice, based on regular, and it is how Mastering Regular Expressions author Jeffrey Friedl says it. The soft-g REJ-eks follows the rule that g before e is soft. Wiktionary lists both.

How do you pronounce regexp?+

Regexp is an alternative spelling of the same word. It is usually said REG-eksp (/ˈrɛɡɛksp/) with the same hard g, though a soft-g REJ-eksp also exists. You will see this spelling in JavaScript's RegExp object.

Do Americans and Brits say regex differently?+

No. Regex is technical vocabulary, and the standard form is the same in both countries: stressed on the first syllable, with the x said as ks. Choosing a hard or soft g is personal preference, not an accent difference.

Is it wrong to say REJ-eks?+

No. It follows a normal English spelling pattern, and plenty of programmers say it that way. If you want the most widely used form, choose REG-eks; if your team says REJ-eks, nobody will misunderstand you.

FIND YOUR VOICE

Hear it in the voice you want

Words, sentences or full scripts: pick a voice and let AI read them aloud.

Try AI voiceover