Are Ruby regexes in 2.1 equivalent in power to those in Perl 5.18?
gvim
Are Ruby regexes in 2.1 equivalent in power to those in Perl 5.18?
gvim
Did you run a diff and benchmark them? Sort of strange one line
question. I
doubt you’ll get a real world response. For the end user that is
effective
with regexes (old school UNIX on every platform systems programmer) the
answer would be yes. For the rest of them let them eat cake since the
cake
is a lie!
On 27/07/2014 17:43, Stu wrote:
Did you run a diff and benchmark them? Sort of strange one line
question. I doubt you’ll get a real world response. For the end user
that is effective with regexes (old school UNIX on every platform
systems programmer) the answer would be yes. For the rest of them let
them eat cake since the cake is a lie!
I was thinking more in terms of features rather than performance. Last I
checked the Onigma regex engine was Perl 5.10 compatible but wondered if
anything has changed since then.
gvim
On Mon, Jul 28, 2014 at 2:25 AM, gvim [email protected] wrote:
I was thinking more in terms of features rather than performance. Last I
checked the Onigma regex engine was Perl 5.10 compatible but wondered if
anything has changed since then.
That cannot be. There is at least one feature in Perl Regex which
does not exist in Ruby: command execution inside the regex engine.
Not that I think it is a good feature to have as it can make the whole
matching process very hard to understand but at least there is no
strict feature equality. But since 1.9 Ruby has lookaround, various
levels of greediness and can even made to match recursive structures
like nested brackets (this extends the class of languages which can be
recognized beyond pure regular languages btw.) - all things that the
Perl RE also features.
I’d go with Stu: for all practical matters since 1.9 (i.e. Oniguruma)
there is nothing I am missing. For a brief overview you can look
here:
http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt
Btw. since Ruby 2.0 the regex engine is called “Onigmo”:
https://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/
Kind regards
robert
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs