简体   繁体   中英

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

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?

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 wrt support of regex capabilities, and see the differences in the table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM