Reputation: 18595
Following a similar answer I would like to ignore words with numbers that are of the following format:
AB12
AB2
CD98
..
this is achieved with use of the following regex:
[A-Z]{2}\d{1,}
The syntax I'm trying:
:syn match ignoredCapitalWords +[A-Z]{2}\d{1,}+ contains=@NoSpell
does not seem to be generating the desired results as the words remain marked as potentially misspelled:
How can I correctly used the previously generated regex to exclude the desired patterns from regex?
Upvotes: 2
Views: 271
Reputation: 806
Php regex engine is not vim regex engine. When you doubt your syntax pattern is right just create a new buffer with desired contents and then use /
command. The given pattern throws an error, you just have to escape each {
character with backslash. So, the correct pattern is: [A-Z]\{2}\d\{1,}
. Never used @NoSpell
but the pattern works.
Upvotes: 2