Ruby uses Perl-compatible regular expressions, so if you’re familiar with the preg_* functions in PHP, you’re already well on your way to learning regular expressions in Ruby.