It seems like a simple problem at first.
Let's start with an example:
using the data set
I would like to be able to match the words
war and
wet while excluding
wee and
woo.
I can match
wee and
woo with this expression:
Is there a way to use "back references" within [] lists?
The expression:
Code:
"^[a-z]([a-z])[\1]$"
does not produce the same results as the previous expression because instead of resolving the '\1' to an 'e' or 'o', it searches for the '\\' and '1' characters.
The reason this is a problem is that I thought that I would be able to write an expression like this:
Code:
"^[a-z]([a-z])[^\1]$"
So is there any way to resolve a back reference within [] lists?
I've been trying to think back to my CS classes to remember if it's even possible for REs to do this sort of thing.