I have this text:
```python x = 1 ```
Basically markdown python cells. I would like to extract the content of the cell surrounding the cursor, if any.
As you may have guessed already, I am trying to build a jupyter workflow, I use jupytex and vim-slime for the console, and I would like to send cells to the console.
Currently I am struggling just matching a cell with regex:
/```python\(\(```\)\@!\)*```
This should match a string starting with ```python, then everything except triple quotes, then triple quotes, but it doesn't.
Strangely, this one(without the ending triple quotes:
/```python\(\(```\)\@!\)*
highlights ```python, but nothing more.
So what would be a regex to match a python cell? Bonus for a regex that matches the content of the cell under cursor!