|
|
||
|---|---|---|
| .. | ||
| readme.md | ||
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