我试图让pyparsing提取由字符串中可变数量的字组成的子字符串。 下几乎工程,但失去的子串的最后一个字: text = "Joe F Bloggs is the author of this book."
author = OneOrMore(Word(alphas) + ~Literal("is the"))
print author.parseString(text)
输出: [
我正在使用pyparsing来摄取gEDA原理图/符号文件格式。大多数是直截了当的,但我不知道如何匹配最初一行上的整数字段指定的以下几行。 文本对象具有类似的格式: (other objects)
T x y color size vis snv angle align num_lines
Text line one
Line two of the text
Finally, the 'n
这里是我的代码: #-------------------------------------------------------------------------------
# Name: Mocha Rotoscoping Via Blender
# Purpose: Make rotoscoping more efficient
#
# Author: Jeff Owens