Regex -ror
From Sandoz
(Difference between revisions)
Sandoz-admin (Talk | contribs) (Created page with "chaine = 'la couleur #FF024D est-elle une couleur HTML ?' test = (chaine =~ /#[0-9A-Fa-f]{6}/) if (test) puts "la chaine #{chaine[test,7]} est un code couleur HTML valide !" ...") |
Sandoz-admin (Talk | contribs) m (Protected "Regex -ror" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite))) |
Latest revision as of 02:02, 14 December 2010
chaine = 'la couleur #FF024D est-elle une couleur HTML ?'
test = (chaine =~ /#[0-9A-Fa-f]{6}/)
if (test)
puts "la chaine #{chaine[test,7]} est un code couleur HTML valide !"
else
puts "Pas de code couleur HTML valide dans la chaine"
end