Tuesday, 20 August 2013

Regular Expression, words with different characters

Regular Expression, words with different characters

I have been searching about it for about 3 hrs, now I'm stuck. Here is the
problem:
I want to find 7 character word where only 4. and 6. chars are same
like:
^...(.).\1.$
but i don't want to find
aaaBaBa
all other chars must different than each other like:
asdBfBg
my question is similar to this one: Java: Regular expression where each
character occurs 0-1 times
but my knowledge wasn't enough to work with Lookarounds (?<= and (?=, (?

No comments:

Post a Comment