I've got strings like the following:

```
Hi X

Blah

Kind regards
ABC

```

And

```
Hi X

Blah

Regards
CBA

```

So the key is the newline and the word "regards" (case insensitive). I'd like to use PHP to get the part of the string before the line that contains "regards". E.g. for these examples, the result should just be:

```
Hi X

Blah

```

I've tried the below but it doesn't work as intended in some cases (E.g. if "Kind" appears multiple times in the string). Thanks in advance!

```
 $matches = array();
        if (preg_match("/\n(.*?)regards/i", $message, $matches) == 1) { 
            $stop_at = $matches[1]; 
            $split = explode($stop_at,$message); 
            $message = $split[0];
        }

```