Skip to content

Commit

Permalink
Create validateColorHexcode.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aakashgarg-19 authored Oct 5, 2022
1 parent 772d350 commit b57edeb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions validateColorHexcode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import re
str = '#ffffff' # Your Hex

match = re.search(r'^#(?:[0-9a-fA-F]{3}){1,2}$', str)

if match:
print 'Hex is valid'

else:
print 'Hex is not valid'

0 comments on commit b57edeb

Please sign in to comment.