Regular expression - dot problem!

Fredrik Lundh fredrik at pythonware.com
Wed Jun 7 16:41:30 EDT 2006


李政 wrote:

> I've a problem with regular express(dot problem). I checked Python 
> Library Reference, but i can't find any infomation that is useful.

like what a dot means in a regular expression?  you really need to work
on your google fu ;-)

in the meantime, look under "The special characters are" on this page:

    http://docs.python.org/lib/re-syntax.html

> *    if re.compile(pattern).match(urldomain) is not None:*
>         return INTERNAL_LINK    # match. url is internal link


if you want to check if the url starts with a given prefix, use

    if url.startswith(prefix):
        ...

</F>




More information about the Python-list mailing list