I know how to get the position of the cursor:

```
editor.selection.active

```

This will yield something like: `{ _character: 4, _line 1 }`

Now, I'd like to match a character or word (in the active editor) and get it's line number and character position:

```
const editor = vscode.window.activeTextEditor
let text = editor.document.getText()
const match = text.match(/match/)

// What should I write here?

```

How to get the line number and character position of the match (or first match)?

I couldn't find anything on Google or VS Code API's documentation.