Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在解析一个可以包含通配符的字符串。如果您将星号放在引号中,我的语法才有效。如何指定文字 *.
selection = QuotedString('"') | Word(printables) | Literal('*')
任何文字 '*' 都会被Word(printables). 你的意思是让这个词由任何不是星号的印刷品组成吗?如果是这样,那么您可以更改为:
Word(printables)
selection = QuotedString('"') | Word(printables, excludeChars='*') | Literal('*')