I have a function that should clean a string , actually I have two kind of string `"SATISFACTION._IS1.TOUTES_SITUATIONS.current_month_note"` or `"SATISFACTION._IS1.TOUTES_SITUATIONS.note"` . 

**PS** *for information `TOUTES_SITUATIONS` is variable* 

What I would return is `"TOUTES_SITUATIONS"`

Here's my code 

```
const extractSituation: Function = (sentence: string): string => {
    return sentence.substring(
        sentence.lastIndexOf('1.') + 2,
        sentence.lastIndexOf('.n'),
    );
};

```

actually it handles only one type of sentence `"SATISFACTION._IS1.TOUTES_SITUATIONS.note"` but not `"SATISFACTION._IS1.TOUTES_SITUATIONS.current_month_note"`

How can I do to handle both of them ?