How to match youtube links?
Matching youtube urls and their IDs
Everything you need to know about writing regular expressions for PHP.
Examples: #F0F0F0
and #333
Regex: ^#([a-f0-9]{6}|[a-f0-9]{3})\b$
Examples: #56ff0077
Regex: ^#([a-f0-9]{8}|[a-f0-9]{4})\b$
Examples: rgb(0,0,0)
Regex: ^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$
Examples: rgba(0,0,0, 0.6)
Regex: ^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*(?:\.\d+)?)\)$
Examples: hsl(0,5%,1%)
Regex: ^hsl\(\s*(\d+)\s*,\s*(\d*(?:\.\d+)?%)\s*,\s*(\d*(?:\.\d+)?%)\)$
Examples: hsla(0, 0%, 1%, .9)
Regex: ^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$