Skip to content

Commit 5a6e98a

Browse files
committed
match_backward turns out to be handy too
1 parent b159d5e commit 5a6e98a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

reap.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,14 @@ def match(self, string, pos=None, endpos=None):
604604
endpos,
605605
)
606606

607+
def match_backward(self, string, pos=None, endpos=None):
608+
return self.execute(
609+
string,
610+
save(0, self.backward) + [Instruction('match')],
611+
pos,
612+
endpos,
613+
)
614+
607615
def search(self, string, pos=None, endpos=None):
608616
return self.execute(
609617
string,

0 commit comments

Comments
 (0)