This is the 8899th most frequent Catalan word.
ex
Former partner.
Here, 'ex' is used as a noun to refer to a former partner, short for 'exparella' in Catalan.
Vaig trobar-me amb la meva ex a la cafeteria.
I encountered my ex at the café.
In this case, 'exemple' is a word containing 'ex' and means 'example' in the context of providing a representation.
Aquest és un exemple de llibre molt interessant.
This is an example of a very interesting book.
'Ex-' is used as a prefix to indicate someone who previously held the title or role described in the word.