I am trying to convert this regular expressions from sublime text into one I can use in vim:
(?<![>\w\d])(42|45|21)\s(?!days)
I would like to match 42, 45, and 21 where they are not immediately proceeded by a <, a word character, or a digit and are not followed by the word days.
In example, I want to find the 42 in this:
This is a reference to chapter 42 in the book.
But not this:
This is a reference to chapter <a href="#">42</a>.
Or this:
This is a reference to chapter <a href="#">42 section 35</a>.
Or this:
This book took 42 days to write.
I am fairly new to regular expressions in general and super new to vim, so please forgive me if this is a malformed regex to begin with.