Reference reading
regg ex
Regex is usually pronounced REG-eks, with a hard g as in regular. A soft-g version, REJ-eks, is also heard.
regex
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.
Compare a reference reading, a direct machine reading, and a contextual sentence. These are not separate US and UK recordings.
regg ex
regex
这个字段用正则 regex 校验。
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
reg-EKS
Stressing ex as if it were a separate word. Like FedEx, regex is stressed on the first syllable: REG-eks.
SayREG-eks
I wrote a regex to check that every email address has an @ sign.
Test your regex on real data before you ship it.
Most programming languages, including Python and JavaScript, support regex.
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.
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.
The questions people ask most when they look up regex.
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.
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.
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.
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.
Words, sentences or full scripts: pick a voice and let AI read them aloud.