I need help to make a regex to find string like:

```
<?php if ($course['image']) { ?>

```

or 

```
<?php if ($course['date']) { ?>

```

and replace with

```
{{$course->image}} or {{$course->date}} or {{$course->whateverindex}}

```

thanks!