Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. hex color code

Tag: hex color code

r
regular expressions October 23, 2009 4 min read by mkyong 3 comments

Java regex hex color code

This article shows how to use regex to validate a hex color code. Regex for hex color code. ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$ Regex explanation ^ # start of the line # # start with a number sign `#` ( # start of (group 1) [a-fA-F0-9]{6} # support z-f, A-F and 0-9, with a length of 6 | # […]

Read more Java regex hex color code

Java and Spring tutorials since 2008. Every example is a complete, runnable file, compiled and run on a real machine before it goes out.

About This Site

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use

© 2026 mkyong.com — Powered by WordPress

RSS