What regex should I use for VS 2010 to find any “#12345A” string – 6 symbols (HEX color) with “” on both sides?
I’ve tried [^0-9]#[0-9]{6}[^0-9] to find at least 6 symbols, but if failed…
I am trying to find all custom colors in projects (non-custom colors have 8 symbols with # before).
Well firstly, you need to include the hex letters, and secondly why not use
"instead ofnot a digit. Also, VS’s quantifiers are a bit different than usual, so you need to escape#(because otherwise it’s equivalent to the+quantifier) and repetition works like^6:See this.