I can't find the right Regex code to match this:
tttttgmust be truetgmust be truetggmust be falsetttggmust be falsetmust be truetttmust be truegmust be falseggggmust be false
There can be any number of occurrences of t but at least one and it can optionally have only a g at the ending.
I tried Match match = Regex.Match("ttgg", @"[t]+{g}|[t]+"); but it returns true, it must return false because there are 2 of g and there can only be one.