[Sugar-devel] [PATCH Chat] Don't treat the whole word as an URL

Manuel Kaufmann humitos at gmail.com
Wed Apr 11 12:41:12 EDT 2012


On Wed, Apr 11, 2012 at 13:39, Manuel Kaufmann <humitos at gmail.com> wrote:
> Changed re.search to re.match because .search scan through the whole string
> looking for the regex. So, for example "asodijfosidwww.google.comaosdfoisad"
> with .search will be treated as a whole URL.
>
> With .match the complete word will be treated as an URL if the whole word
> matches with the regular expression.

http://docs.python.org/library/re.html#re.match
http://docs.python.org/library/re.html#re.search

http://docs.python.org/library/re.html#search-vs-match

-- 
Kaufmann Manuel
Blog: http://humitos.wordpress.com/
Porfolio: http://fotos.mkaufmann.com.ar/
PyAr: http://www.python.com.ar/


More information about the Sugar-devel mailing list