8
Answers

Regex Hex Match

David Smith

David Smith

12y
4.3k
1
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)
Next Recommended Forum