ruby-uebungen/Assignment_030/solution
Thomas Smits 58bc23516c Update of exercises 2023-05-25 17:49:42 +02:00
..
readme.md Update of exercises 2023-05-25 17:49:42 +02:00

readme.md

Lösung: Reguläre Ausdrücke: Match

def tag?(text)
  !!(/^<.*?>$/ =~ text)
end

tag?("<a href='xx'>") # -> true
tag?("hugo <jjj>") # -> false
tag?("<a href='xx'") # -> false
tag?("<p/>") # -> true
tag?("<p") # -> false
tag?("p>") # -> false