Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wimglenn
-
I think I understand now, thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Znunu # -- EXAMPLE: Parse something in the middle (independent of prefix)
import parse
@parse.with_pattern(r".*")
def parse_any_text(text):
return text
schema = "{:AnyText}there are {} inside"
text = "xxx there are 5 birds inside"
parse.parse(schema, text, extra_types=dict(AnyText=parse_any_text))
# -- RETURNS: <Result ('xxx ', '5 birds') {}> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say I have one of two possible strings
I want to get "five birds", I've tried the following:
this fails with the second example:
this fails with the first example:
this doesn't work as there's a space between "five" and "birds":
Beta Was this translation helpful? Give feedback.
All reactions