I have a regex pattern like this
(\w)(..\1..\1|...\1...\1|....\1....\1|.....\1.....1)
I want to make it shorter. As we can see the number of dots is from 2 to 5. I want to write something like (\w)(.{2,5}\1){2} but in this case it will match some wrong strings q00q000q. Also I can try to use number reference but it repeats chars from a string instead of symbols .. Is it possible to repeat pattern .{2,5} as a specific count of .?
UPDATE It was a challange about tic-tac-toe game. I needed to write down a regexp of length <=50 which can be used to find out if somebody wins
\..