Why does this backreference not work inside a lookbehind?

Viewed 1855

Matching a repeated character in regex is simple with a backreference:

(.)\1

Test it here.

However, I would like to match the character after the pair of characters, so I thought I could simply put this in a lookbehind:

(?<=(.)\1).

Unfortunately, this doesn't match anything.

Why is that? In other flavours I wouldn't be surprised because there are strong restrictions on lookbehinds, but .NET usually supports arbitrarily complicated patterns inside lookbehinds.

1 Answers
Related