Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Regex syntax in Ruby vs Perl?

Tags:

regex

ruby

In my understanding, when Matz invented Ruby, he pretty much lifted a lot of Perl language constructs and duplicated them. Does this extend to regular expressions as well, or are there any syntactical differences that I should be aware of?

like image 772
danieltahara Avatar asked Mar 01 '12 16:03

danieltahara


1 Answers

There's an extensive comparison of regex support in many languages at https://www.regular-expressions.info/refbasic.html and its sibling pages. Enter the two languages that you want to compare w.r.t. support of regex capabilities, and see the differences in the table.

like image 61
Jochem Schulenklopper Avatar answered Oct 13 '22 07:10

Jochem Schulenklopper