Skip to content

Instantly share code, notes, and snippets.

@qnighy
Created August 31, 2009 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qnighy/178354 to your computer and use it in GitHub Desktop.
Save qnighy/178354 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby -Ku
# -*- coding: utf-8 -*-
r = /\A(([あいうえおか-もやゆよら-ろわ-んアイウエオカ-モヤユヨラ-ロワ-ヴ]|う゛)[ぁぃぅぇぉゃゅょゎァィゥェォャュョヮ]?){2}[×☆]?(([あいうえおか-もやゆよら-ろわ-んアイウエオカ-モヤユヨラ-ロワ-ヴ]|う゛)[ぁぃぅぇぉゃゅょゎァィゥェォャュョヮ]?){2}っ?!?\z/
while l = gets
l.chomp!
if r.match(l)
puts "#{l}は4文字タイトルなんじゃないかなあ"
else
puts "#{l}は4文字タイトルじゃないんじゃないかなあ"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment