Let\'s say I have two strings like this:
XABY XBAY
A simple regex that matches both would go like this:
X(AB|BA)Y
If there are several strings, with any kind of characters in there, you'll be better with:
X(.)+Y
Only numbers then
X([0-9])+Y
Only letters
X([a-zA-Z])+Y
Letters and numbers
X([a-zA-Z][0-9])+Y