I have the following regex:
%(?:\\.|[^%\\ ])*%([,;\\\s])
This works fine, but obviously also highlights the next character with the last % .
I was wondering how can I exclude it from regex?
For example, if I have:
The files under users\%username%\desktop\ are:
It will highlight %username%\ , but I just want %username% . On the other hand, if I leave the regex as follows:
%(?:\\.|[^%\\ ])*%
... then it will match this pattern that I don't want:
%example1%example2%example3
Any idea how to exclude the last character in a match through regex?
source share