Python sqlite and regex.

Ben Finney bignose+hates-spam at benfinney.id.au
Fri May 19 20:58:20 EDT 2006


John Salerno <johnjsal at NOSPAMgmail.com> writes:

> Paul McGuire wrote:
> > "Paul McGuire" <ptmcg at austin.rr._bogus_.com> wrote in message
> > news:hunbg.46845$CH2.29994 at tornado.texas.rr.com...
> > 
> >> where '*' matches one or more characters, and '?' matches any
> >> single
> > 
> > oops, I meant '*' matches zero or more characters.
> 
> '?' also matches 0 characters

Not in globs. In a glob, '?' matches any one character, '*' matches
any zero or more characters.

In a regex, '.' matches any one character, '?' matches the preceding
atom zero or one times, '*' matches the preceding atom zero or more
times, and '+' matches the preceding atom one or more times.

They're quite different syntaxes, but confusingly similar in
appearance.

On most GNU+Linux systems, these two commands get the relevant manual
pages:

    $ man 7 glob
    $ man 7 regex

-- 
 \          "When I get real bored, I like to drive downtown and get a |
  `\         great parking spot, then sit in my car and count how many |
_o__)                 people ask me if I'm leaving."  -- Steven Wright |
Ben Finney




More information about the Python-list mailing list