How to Pronounce <ex> 

<ex> has 3 pronunciations in English depending on its usage and the following sounds as follows:

1. EX- /ɛks/

As a prefix meaning “former” EX is always pronounced /ɛks/:

ex-wife /ˌɛksˈwʌɪf/
ex-husband /ˌɛksˈhʌzbənd/
ex-directory /ˌɛksdʌɪˈrɛkt(ə)ri/

This is also the pronunciation of the noun EX, which means former partner:

“My ex /ɛks/ is picking up the kids today.”

2. EX+consonant /ɪks,ɛks/

In words that begin with unstressed <ex> where the next sound is a consonant, the pronunciation is most commonly /ɪks/:

expect /ɪksˈpɛkt/
excite /ɪkˈsʌɪt/
extend /ɪkˈstɛnd/

/ɛks/ is also possible though less common in the above words. If the word has stress on <ex> then it will be pronounced /ɛks/:

excellent /ˈɛksələnt/
expert /ˈɛkspəːt/
extra /ˈɛkstrə/

3. EX+vowel /ɪgz,ɛgz/

In words that begin with unstressed <ex> where the next sound is a vowel, the pronunciation is most commonly /ɪgz/:

example /ɪgˈzɑːmp(ə)l/
exert /ɪgˈzəːt/
exude /ɪgˈzjuːd/

/ɛgz/ is also possible in these words, though less likely.