perl re "translation"

B

borges2003xx

hi everyone.
some good fellow can help me to "translate" a python re in perl ?

r=re.compile(r'(?P<s1>.)(?P<s2>.)(?P<s3>.)(?P<s4>.)(?P<s5>.).*(?P=s5)(?P=s4)(?P=s3)(?P=s2){1,}(?P=s1){1,}')

it takes a five sequential substring of length 1 and tests if the same
sequence in reverse order follows.

thanx everyone
 
P

Peter Wyzl

hi everyone.
some good fellow can help me to "translate" a python re in perl ?
r=re.compile(r'(?P said:
it takes a five sequential substring of length 1 and tests if the same
sequence in reverse order follows.

m/(.)(.)(.)(.)(.)\5\4\3\2\1/



P
 
B

borges2003xx

thank a lot.
And if i ask that s2 must be of length 3 or more?
thanks again
 
B

borges2003xx

Anno Siegel ha scritto:
Is this a quiz or what? What's the next question?

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.

sorry. Really sorry. it is not a quiz. it a way for me to understand
something of an obscure argument. sorry again but i'm study python but
re are very slow and so i think of perl implementation
 
J

John W. Krahn

some good fellow can help me to "translate" a python re in perl ?

r=re.compile(r'(?P<s1>.)(?P<s2>.)(?P<s3>.)(?P<s4>.)(?P<s5>.).*(?P=s5)(?P=s4)(?P=s3)(?P=s2){1,}(?P=s1){1,}')

it takes a five sequential substring of length 1 and tests if the same
sequence in reverse order follows.

my $r = qr/(.)(.)(.)(.)(.).*\5\4\3\2{1,}\1{1,}/;



John
 

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,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top