LoginSignup
6
5

More than 5 years have passed since last update.

Rubyにおける正規表現のチェック

Posted at

Rubyにおける正規表現のチェックをする。
以下の例では、trueとなり、ifの中に入ります。

//20002099に一致するか確認
check = "2015"
if /[012][0][0-9][0-9]/ =~ check
end
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5