LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2017, 07:02 AM   #1
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Ubuntu, Devuan, OpenBSD
Posts: 2,621
Blog Entries: 3

Rep: Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155
PCRE in Python


How complete a subset of Perl's pattern matching is in Python's PCRE? Which version of Perl is it equivalent to?
 
Old 06-15-2017, 12:54 PM   #2
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 340

Rep: Reputation: 181Reputation: 181
I have virtually no experience with Perl, so all I can do is refer you to documentation of re module from Python standard library.
 
1 members found this post helpful.
Old 06-15-2017, 01:15 PM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,767

Rep: Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886
Oh, yes, there is no perfect answer. All of the PCRE implementations are different, but you can say they are mainly offering only a subset of the real perl implementation. But obviously/unfortunately it also depends on the version of PCRE/perl itself. I wouldn't say about equivalence.
If you need a special kind of RE you need to check if that works. If you have a special case please show us. I think in most cases the rework of those REs may help.
 
Old 06-16-2017, 03:06 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,620

Rep: Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948Reputation: 2948
No idea. But in addition to the documentation that adriusk referred you to:

Quote:
Originally Posted by audriusk View Post
I have virtually no experience with Perl, so all I can do is refer you to documentation of re module from Python standard library.
you can also look at the unit tests:

https://github.com/python/cpython/bl...st/re_tests.py

Last edited by dugan; 06-16-2017 at 03:15 PM.
 
1 members found this post helpful.
Old 06-17-2017, 11:24 AM   #5
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Ubuntu, Devuan, OpenBSD
Posts: 2,621
Blog Entries: 3

Original Poster
Rep: Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155
Quote:
Originally Posted by dugan View Post
you can also look at the unit tests:

https://github.com/python/cpython/bl...st/re_tests.py
Thanks. That is very useful. I can compare that against this one, if I understand the two test files correctly:

https://github.com/Perl/perl5/blob/blead/t/re/re_tests

It looks like manual comparison is necessary.

pan64, I don't have a specific use-case handy. It is more a wish to know the relative status.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] can't run make for PCRE User247 Linux - Server 8 11-07-2014 05:47 PM
[SOLVED] PCRE Validation Linux_Kidd Programming 8 06-28-2012 09:34 PM
[SOLVED] PCRE Question MTK358 Programming 11 06-01-2011 12:12 PM
How to use PCRE in C ? raiux Programming 1 11-23-2007 07:43 AM
PCRE Regex Osiris990 Programming 10 10-22-2007 03:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration