I am trying to find a pattern match using php.

My string contains something like this

```
{{ @sql( select [name] from [table] where [col1] = 50 AND [col2] = :alt_id_1 AND [col3] = :id  ) }}

```

I would need to return the following data

1. The portion the string that matches
2. The string that comes between `{{@sql(` and `)}`
3. Any keyword that starts with colon `:`

For example, if I have the following string

```
$subject = 'Hello This is a test. The value found is "{{ @sql( select [name] from [table] where [col1] = 50 AND [col2] = :alt_id_1 AND [col3] = :id  ) }}".';

```

Then for the first bullet I will need to return `{{ @sql( select [name] from [table] where [col1] = 50 AND [col2] = :alt_id_1 AND [col3] = :id ) }}`

For the second bullet I would need to return `select [name] from [table] where [col1] = 50 AND [col2] = :alt_id_1 AND [col3] = :id`

For the last bullet, I would return an array with `:alt_id_1` and `:id`

Here is what I tried

```
$pattern = '/\{\{\s*+@sql(*)+\s*+\}\}/i';
$matches = [];
preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE);
echo '<pre>';
print_r($matches );
echo '</pre>';

```

But it is giving me an exception 

```
preg_match_all(): Compilation failed: nothing to repeat at offset 13

```