The basic idea is something like
1 or more digits
a space (optional)
X
another space (optional)
1 or more digits
The exact syntax depends on what language you're using, but it would look something like
s/\d+[ ]?X[ ]?\d+//
or, if you want to be sure that the X either has spaces on both sides or none at all, you can separate the two cases:
s/(\d+ X \d+)|(\d+X\d+)//
This will cover exactly the two example cases you mentioned. If you want to allow any amount of whitespace around the X, or allow the X to be lower case, chaos's solution covers that.