I need to search for a keyword, such as "abcdef", which can also be in an abbreviated version with a dot at the end. All valid variants are:
abcdef
abcde.
abcd.
abc.
ab.
a.
I have a regular expression for this, which is clear:
abcdef|abcde\.|abcd\.|abc\.|ab\.|a\.
Another regular expression where the keyword characters are not repeated:
a(b(c(d(e(f|\.)|\.)|\.)|\.)|\.)
I'm looking for a more compact expression where not even a dot will be repeated. I use .NET syntax.