This works as expected. See https://docs.python.org/3/library/re.html
#search-vs-match .

** Changed in: python3-defaults (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/1655214

Title:
  re.match is anchored to the beginning of the string.

Status in python3-defaults package in Ubuntu:
  Invalid

Bug description:
  All matches, whether compiled or not, appear to be anchored to the beginning 
of the target string.
  Un-anchoring requires a beginning ".*" in the pattern

  kevin@plato-x:/raid/917$ python3
  Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
  [GCC 5.4.0 20160609] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import re
  >>> a="ply03"
  >>> re.match("ply",a)
  <_sre.SRE_Match object; span=(0, 3), match='ply'>
  >>> re.match(".*3",a)
  <_sre.SRE_Match object; span=(0, 5), match='ply03'>
  >>> re.match("3",a)
  >>> re.match("[ly03]",a)

  
  The last 2 should succeed, but don't.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: python3 3.5.1-3
  ProcVersionSignature: Ubuntu 4.4.0-57.78-generic 4.4.35
  Uname: Linux 4.4.0-57-generic x86_64
  NonfreeKernelModules: wl
  ApportVersion: 2.20.1-0ubuntu2.4
  Architecture: amd64
  CurrentDesktop: XFCE
  Date: Mon Jan  9 19:36:47 2017
  InstallationDate: Installed on 2016-08-08 (154 days ago)
  InstallationMedia: Xubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 
(20160719)
  SourcePackage: python3-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1655214/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to