Say I have a string of only a's and b's, like so:
aaabbbbababab
How can I construct a regex, that will match the given string only if the second and last character are different?
This is my current attempt, that does the exact opposite (e.g. matches if second and last character are the same):
^[ab]([ab])[ab]*\1$
I am using the ECMAScript implementation of regex.