David Smith

David Smith

  • NA
  • 2k
  • 0

Regex Hex Match

Mar 26 2012 1:22 AM
Can someone help me write the regex for  recognizing any hex value, I am struggling

                                Regex regexHexMatch = new Regex("\b0x[a-fA-F0-9]+\b");

                               if (regexHexMatch.IsMatch(data.ColorValue))
                                {

                                    continue;
                                }

                                else
                               {

                                  //Do something

                                 }

Answers (8)