LATEST CHATTY HEADER
Subscribe to Shacknews Mercury starting at $1/month!
Chrome Shack Community Guidelines Chatty Search
Scroll down to join the conversation.
New to Shacknews? Signup for a Free Account
Already have an account? Login Now
Subscribe to Shacknews Mercury starting at $1/month!
Chrome Shack Community Guidelines Chatty Search
Scroll down to join the conversation.
Got a project that I'm kinda really happy with that I just published. It extracts colors from text that's pasted in. Currently it only pulls 6 digit hex. It doesn't care what kind of text is pasted in, it will regex search for anything it can find that looks like it might be a hex color.
http://zrservice.com/wp/wp-content/uploads/2009/04/ColorHound.html
Curious what you guys think, and let me know if you can manage to break it!
Thread Truncated. Click to see all 28 replies.
/\W{1}[0-9a-f]{6}\W{1}/ig
Which should catch any 6 digit 0-9, a-f with a non-alphanumeric on either side, ignoring case and global search returning an array (the /ig part). (I cheat on the beginning and end of the input by adding the start/end text first.
I see that it also breaks on
#000000#323232#000000#323232 and
#aaaaaa#333333#a2c3b1#a2b1c3
In different combinations smashed together single non-alphanumeric character delimited codes break, but not all combinations.
The post has been reported. Thank you!
You must be logged in to post.
You must be logged in to post.