2022-08-07 Bruno Haible <bruno@clisp.org>
+ gnulib-tool.py: Make regex uses more straightforward.
+ * pygnulib/constants.py: Don't use the "minimal matching" *? construct
+ when it makes no difference (because we're matching a single line only
+ and flag re.M is not specified).
+ * pygnulib/GLModuleSystem.py: Likewise.
+
gnulib-tool.py: Make regex uses more straightforward.
* pygnulib/GLModuleSystem.py: Don't use flag re.S on regular expressions
that are meant to match a single line only, and remove the use of the
'''GLModule.getName() -> str
Return the name of the module.'''
- pattern = re.compile(joinpath('modules', '(.*?)$'))
+ pattern = re.compile(joinpath('modules', '(.*)$'))
result = pattern.findall(self.module)[0]
return result
listing = list()
for filename in filelist:
if filename.startswith(prefix) and filename.endswith(suffix):
- pattern = re.compile('^%s(.*?)%s$'
+ pattern = re.compile('^%s(.*)%s$'
% (removed_prefix, removed_suffix))
result = pattern.sub('%s\\1%s'
% (added_prefix, added_suffix), filename)