I have a string that I want to transform into a dictionary, the string looks like this:

```js
const str = '::student{name="this is the name" age="21" faculty="some faculty"}'

```

I want to transform that string into a dictionary that looks like this:

```js
const dic = {
  "name": "this is the name",
  "age": "21",
  "faculty": "some faculty"
}

```

So the string is formated in this was `::name{parameters...}` and can have any parameters, not only `name`, `faculty`, ... How can I format any string that looks like that and transform it into a dictionary?

Also Is there a way to check that the current string I'm parsing follow this structure `::name{parameters...}`, that way I can throw an error when it does not.

Any help would be greatly appreciated!