Are Python regular expressions PCRE compatible
I can't promise you that, I concentrated on the Perl code and I don't know whether the Perl REs from the examples can be transferred to PCRE. PCRE doesn't always have what it says on it ("Perl Compatible ...").
snafu wrote:Hm, parse nested structures is exactly what I'm interested in at the moment. And if you can transfer the PHP examples, that would be really great.
IIRC he creates (in many ways) a recursive pattern in which he repeats RE sections depending on recursion conditions
However, in theory PHP and Python should be compatible.
The PHP part says at least:
475 Recursive Expressions
475 Matching Text with Nested Parentheses
476 Recursive reference to a set of capturing parentheses
476 Recursive reference via named capture
477 More on possessive quantifiers
Just have a look at the bookstore ... I did too!
The code examples can also be downloaded from O'Reilly.
(UPDATE: at least you could do that earlier)
BTW: real regular expressions wouldn't allow recursions.
1) yup should help "(? R)" has become standard in both PCRE and Perl.
see also "RECURSIVE PATTERNS" at http://www.pcre.org/pcre.txt.
perldoc perlre also contains examples for the use of "(? PARNO)" (PARNO is the number of the preceding grouping bracket)
- What do Romanians think of Trajan?
- Are there examples of positive socialist societies
- What makes a person into a stalker
- What is prophylaxis
- What removes water stains from the finished table
- What is meant by investment
- How can I KO a big guy
- What is a one-page website
- How can universe knowledge be obtained
- Is the right to privacy negotiable
- How isolated are houses in Edmonton Alberta
- What does Copyright 2015
- What happens to blood after death
- Where are the Voyager probes going next
- First nights of the Indian honeymoon
- What are some traditional Indian sweets
- What is a PM name
- How do I organize overcrowded thoughts
- What is leppen in m20 class concrete
- What are some examples of suburbs
- Which industries still use animal testing?
- How do I get over her past
- What does Yada Yada
- Is Haiti safe to visit
- What should everyone know about your city
- Is Tel Aviv a clean city
- Why are people almost extinct
- Why do we compete with each other
- How much does the EOS lip balm cost
- If 12x 10 10 what is x
- Is death painful from living cooking
- Which president died before George Bush
- What is the herb tasty
- Which language has more science