Reputation: 2210
I'm currently parsing a string, which can contain wildcards. My grammar only works, if you put the asterisk in quotes. How do you specify a literal *.
selection = QuotedString('"') | Word(printables) | Literal('*')
Upvotes: 2
Views: 566
Reputation: 63749
Any literal '*' is going to get sucked up into a Word(printables)
. Do you mean to have the word be made up of any printables that aren't asterisks? If so, then you can just change to:
selection = QuotedString('"') | Word(printables, excludeChars='*') | Literal('*')
Upvotes: 1