Thetimehascomethewlrussaid
New Member
This should be easy...I'm trying to match 3 hex digits in a row in a css file with ruby. Here's what I've got..\[code\]File.open(ARGV[0], 'r') do |source| source.each { |line| puts line if line =~ /\h{3}/}end\[/code\]This doesn't return anything back in a file that has several of such values. if I change line to be \[code\]line =~ /\h/\[/code\] then virtually every line gets returned. I know I must be missing something basic but what is it?EDIT. Here's some sample input. Valid hex colors of course can be three hex value combinations, but for now im just concerned with the six valued ones.\[code\]#captcha fieldset{border-top:1px solid #c0c0c0;border-bottom:1px solid#c0c0c0;margin:0;padding:10px}#captcha legend{color:gray}#captcha .divider{display:none}#captcha .captcha_refresh{font-size: 9px;color:gray}#captcha .captcha_other_options{padding-top:5px;font-size: 9px}#captcha .recaptcha_text{font-size: 11px;line-height:16px}#captcha .captcha_optout{font-size: 11px;padding:10px 0 5px}#captcha #recaptcha_image{font-weight:bold;margin:10px 0 0 0}#captcha #recaptcha_image a.recaptcha_audio_cant_hear_link{font-size: 9px;font-weight:normal}#captcha .captcha_loading{border:0}#captcha .captcha_image img{border:1px solid #c0c0c0}#captcha .captcha_input input{direction:ltr;margin-top:4px;width:137px}#captcha .captcha_input label{margin-right:4px}.register #captcha .captcha_input label{color:#666;font-weight:bold}#generic_dialog.captcha .generic_dialog_popup{width:340px}\[/code\]