I have a document that contains lines like
![My title](/path/to/image.jpg)
This is the format for images in Markdown.
I have constructed a regular expression which I believe should be able to find the image tags:
!\[(.*)\]\((.+)\)
But when I try the command /!\[(.*)\]\((.+)\)
, I get E486: Pattern not found: !\[(.*)\]\((.+)\)
.
Motivation
I am trying to do this to change how images are presented in my Hugo static site. I want to be able to search and replace everywhere in a file with
%s/!\[(.*)\]\((.+)\)/{{< figure alt="\1" src="\2" >}}/
If it matters, I'm using Vim version 8.0.1283.
\(\)
instead of()
and for capturing at least one of the previous items, you need to use\+
instead of+
.