From 6204c785395ec2ec82a757180be1aa5a7e280f01 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 25 Jun 2022 16:40:08 +0200 Subject: cws-status: Match regex anywhere in the name I didn't realise that `re.match()` only matches starting at the beginning of the string rather than matching anywhere inside it: https://docs.python.org/3/library/re.html#re.match Switch to `re.search()` to get the desired behaviour. --- cws-status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cws-status b/cws-status index b332f77..d6302e7 100644 --- a/cws-status +++ b/cws-status @@ -90,5 +90,5 @@ item_statuses = tree.xpath('//table[//th[text()="Item"]]/tbody/tr/td[7]/text()') # Print the publish status for the queried extensions. for i, name in enumerate(item_names_versions): - if re.match(regex, name): + if re.search(regex, name): print(f'{name}\t{item_statuses[i]}') -- cgit v1.2.3