[Tutor] a little help with the re odule
nathan tech
nathan-tech at hotmail.com
Sat Jul 18 06:57:10 EDT 2020
Hi there
I hope everyone is well.
I'm trying to do a little bit of work with the re module but have rather
gotten stuck and am hoping someone will be able to fill in the gaps in
my understanding.
First, what I'm trying to do:
I want to match one string to another, but the match pattern has to be
flexible.
In this regard, what I'd like to do is:
User supplies: The cat sat on the mat.
The match pattern is: The * sat on the *
Now with this example a bit of work with the \w match would work fine.
What I can not figure out is lets say I have the match pattern: The *
sat on the *
What I want to do is for that to match all of the following:
the cat sat on the mat
The dog sat on the shoe
The dog and the cat sat on the hoverboard.
The big angry mouse sat on the mat and ate it.
Is this even possible?
Thanks for any help.
Nathan
More information about the Tutor
mailing list