Question about metacharacter '*'

rxjwg98 at rxjwg98 at
Sun Jul 6 13:51:03 CEST 2014


I just begin to learn Python. I do not see the usefulness of '*' in its
description below:

The first metacharacter for repeating things that we'll look at is *. * doesn't
match the literal character *; instead, it specifies that the previous character
can be matched zero or more times, instead of exactly once.

For example, ca*t will match ct (0 a characters), cat (1 a), caaat (3 a
characters), and so forth. 

It has to be used with other search constraints?


More information about the Python-list mailing list