-
-
Notifications
You must be signed in to change notification settings - Fork 293
Closed
Description
import pyparsing as pp
str_text = "get a b c from cup;"
content = pp.Word(pp.alphas)
content_pos = pp.OneOrMore(content).set_name("contents")
container = pp.Word(pp.alphas).set_name("container")
end_flag = ';'
get = pp.Keyword('get')
from_ = pp.Keyword('from')
pattern = get + content_pos + from_ + container + end_flag
print(pattern.parse_string(str_text))
I got an error pyparsing.exceptions.ParseException: Expected Keyword 'from', found ';' (at char 18), (line:1, col:19)
from
is matched by content_pos
But I want from
as a keyword to be matched by from_
How should I fix it, thanks
Metadata
Metadata
Assignees
Labels
No labels