⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.118
Server IP:
93.127.187.240
Server:
Linux sg-nme-web1518.main-hosting.eu 5.14.0-611.16.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Dec 22 03:40:39 EST 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.3.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
gsutil
/
third_party
/
pyparsing
/
examples
/
View File Name :
matchPreviousDemo.py
# # matchPreviousDemo.py # from pyparsing import * src = """ class a ... end a; class b ... end b; class c ... end d;""" identifier = Word(alphas) classIdent = identifier("classname") # note that this also makes a copy of identifier classHead = "class" + classIdent classBody = "..." classEnd = "end" + matchPreviousLiteral(classIdent) + ";" classDefn = classHead + classBody + classEnd # use this form to catch syntax error # classDefn = classHead + classBody - classEnd for tokens in classDefn.searchString(src): print(tokens.classname)