How to convert Ruby regex to PCRE
Ruby Regular Expressions are PCRE
regular expressions because PCRE supports Perl Compatible Regular Expressions and defines a specific syntax for the regular expressions that it supports.
For help on the individual functions of the PCRE regex, see the second article related to specific ruby methods, see the first (as you will see, the syntax of the regexp used is the same)
EDIT: As pointed out in the comments, the regex engine used by Ruby, Onigmo
which, according to the page link, has some of the newer Perl 5.10 features. PCRE is a regular expression library and "Current PCRE implementation is roughly Perl 5.12" so there might be some inconsistencies around the edges. The syntax is much the same, but check out the Onigmo gigub page and the ruby api dock to see the difference. By and large though, it's probably safe to assume that most of the regexes you translate from ruby to PCRE will work without issue.
source to share