Public bug reported:

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)

** Affects: python3-defaults (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1655214

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

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to