Re: [PATCH 1/2] debian-squeeze: Fix volume-id expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 19, 2016 at 11:20:02PM +0200, Fabiano Fidêncio wrote:
> The volume-id expression should be able to match things like: 6.0.0,
> 6.0.1a, 6.0.10.

Oh, do they really use .1a? Can we have a testcase for it? How is it
ordered, I assume this is hex representation?

> [ffidenci@cat libosinfo]$ python

should be python 3, we are in 2016 ;)

> Python 2.7.11 (default, Feb  5 2016, 01:53:41)
> [GCC 6.0.0 20160201 (Red Hat 6.0.0-0.9)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import re
> >>> re.match(r'6.\d.\d\d?\d?', '6.0.0')
> <_sre.SRE_Match object at 0x7f50d7de2578>
> >>> re.match(r'6.\d.\d\d?\d?', '6.0.1')
> <_sre.SRE_Match object at 0x7f50d7de25e0>
> >>> re.match(r'6.\d.\d\d?\d?', '6.0.1a')
> <_sre.SRE_Match object at 0x7f50d7de2578>

Nope, this is not correct, you matched '6.0.1', not the full string:

>>> re.match(r'6.\d.\d\d?\d?$', '6.0.1a')
>>>


Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux