Skip to content

How do I match in the middle of a string? #189

Answered by wimglenn
Znunu asked this question in Q&A
Discussion options

You must be logged in to vote
>>> my_string1 = "there are five birds inside"
>>> my_string2 = "randomstring there are five birds inside"
>>> search("there are {} inside", my_string1)
<Result ('five birds',) {}>
>>> search("there are {} inside", my_string2)
<Result ('five birds',) {}>

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by wimglenn
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #183 on August 21, 2024 15:51.