The term regular expression is often shortened to regex. What is the correct pronunciation of the g in regex?
Is it like the g1 in gallium, or is it like the g2 in giraffe? I’ve heard it said both ways.
1. IPA /g/
2. IPA /dʒ/
Instead, I normally use "regex." It just rolls right off the tongue ("it rhymes with "FedEx," with a hard g sound like "regular" and not a soft one like in "Regina") and it is amenable to a variety of uses like "when you regex ...," "budding regexers," and even "regexification."
So, if you are looking for an authoritative answer, the above is it.
In a footnote, Friedl also adds:
You might also come across the decidedly unsightly "regexp." I'm not sure how one would pronounce that, but those with a lisp might find it a bit easier.
FWIW, I pronounce it with the soft g simply because it sounds better to mine ears. However, most of the programmers I know do employ the hard g.
Sweet reason clearly dictates, as an abbreviation of regular, it should be pronounced /ɹɛ.ɡɛks/. However, I've heard it said thousands of times and far more often than not, it is pronounced /ɹɛ.dʒɛks/. Dunno why, but there it is.
I've always heard rejeks or even reejeks. Never heard any other pronunciation. It doesn't lend itself very well to extending. I've been regexing is weird. I never say "regex" to the uninitiated or even "regular expression". Stick instead with word or character pattern.
It matters how you link the word to Regular Expression.
1) RegEx => /ɹɛɡ.ɛks/ => You're new to Regular Expression - the word. You're capturing it with two words Reg and Ex.
2) regex => /ɹɛdʒɛks/ => You're very familiar with the word Regular Expression - your mind doesn't remember the full word when you say
regex. You think it a whole word to Regular Expression.
So, if you're pronouncing it with the hard g sound, then your mind still captures the full word. And if you're pronouncing it with soft g sound, then your mind doesn't capture the full word but you just capture the word
regex as full word.
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?