Searching for simple variable names like 'c' or 'x' in Emacs.
- by wpeters
I often wish to search for variables that are simply called 'c' or 'count'.
For example
int c, count;
Unfortunately when I use an incremental search for 'c' or 'count' I get a lot of unnecessary hits like the 'c' in 'choice', or the 'count' in 'wordcount' which do not interest me. I know Emacs can do i-searches with regular expressions but I don't know the correct regular expression needed to match just 'c' and 'count'. These words are often surrounded by any number of white spaces. Anyone know the regex I can use to narrow my search?