Skip to content

Instantly share code, notes, and snippets.



Created Apr 23, 2010
What would you like to do?
grep =#HEXRGB, =\#HEXRGB or =0,0,0..=255,255,255 (rgb values)
# grep =#HEXRGB, =\#HEXRGB or =0,0,0..=255,255,255 (rgb values) from a simple 'key=value' file.
# e.g. Java # properties. (Eclipse .prefs, windows .ini)
cat file.prefs | grep -E -i -e '=\#([0-9|A-F]){6}|=\\\#[0-9|A-F]|=([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(,([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){2}[^ ,0-9]';

This comment has been minimized.

Copy link
Owner Author

@jasonm23 jasonm23 commented Apr 24, 2010

The hexrgb matching could be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment