RegExps: are they full Perl5?

J

John Andrews

How close is Ruby's Regexp support to Perl5 (say, Perl 5.6.1)?

The PickAxe book covers Regexp's in maybe 15 pages (with repetition),
whereas "Programming Perl" 3rd edition takes on the order of 100 pages
(I don't have my copy handy to give an exact count).

I've spent some time comparing the two Regexp languages. The
PickAxe book does not mention some operators that are in the
Perl book. These are so obscure that I don't know how to create
a Ruby testcase.

The reason I'm asking is that I'm giving a talk at my company
about how Ruby compares with Perl (which we currently use), and
I'd like to make an accurate statement about Ruby's Regexp support.

Thanks,

John Andrews, Ruby Convert
Tensilica, Inc.
 
R

Robert Klemme

John Andrews said:
How close is Ruby's Regexp support to Perl5 (say, Perl 5.6.1)?

The PickAxe book covers Regexp's in maybe 15 pages (with repetition),
whereas "Programming Perl" 3rd edition takes on the order of 100 pages
(I don't have my copy handy to give an exact count).

I've spent some time comparing the two Regexp languages. The
PickAxe book does not mention some operators that are in the
Perl book. These are so obscure that I don't know how to create
a Ruby testcase.

The reason I'm asking is that I'm giving a talk at my company
about how Ruby compares with Perl (which we currently use), and
I'd like to make an accurate statement about Ruby's Regexp support.

I'd say they are quite near but don't match exactly. (Just recognizing
how well the m* word fits here... :))) Especially Ruby doesn't have look
behind, only look ahead: (?=...) and (?!...)

Personally I'm have only missed this feature once or twice, but not really
urgently.

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top