The problem is the input will be much more complex than the example, it could be something like "30 minutes later" where any string starting with a number is a possible match.
Paul McGuire 寫道: > "Andy" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi there, > > > > I'm trying to do some predicting work over user input, here's my > > question: > > > > for pattern r'match me', the string 'no' will definitely fail to match, > > but 'ma' still has a chance if user keep on inputting characters after > > 'ma', so how do I mark 'ma' as a possible match string? > > > > Thanks a lot, > > > > Andy > > > Maybe .startsWith might be more useful than re.match, since you are > predicting user input based on characters that have been typed so far. > > -- Paul
-- http://mail.python.org/mailman/listinfo/python-list