Can't create a regular expression that would select the "X" symbol that is between digits and a word does not contain other letters or "X" is on the first or last place of a word. Examples:
- test123X123test - should not find X because there are letters in word
- test 123X123 test - should find X because there is no letters (except X) in word
- 123X123 test - should find X
- test 123x123 - should find X
- 123X - should not find X because X is on the last place
- X123 - should not find X because X is on the first place
I was wondering if anyone could help me. Btw I use ruby, so the regular expression must work with it.