bug-gnulib
[Top][All Lists]
Advanced

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

gnulib-tool.py: Simplify regular expressions.


From: Collin Funk
Subject: gnulib-tool.py: Simplify regular expressions.
Date: Thu, 11 Apr 2024 11:36:28 -0700
User-agent: Mozilla Thunderbird

I decided to try PyCharm again since I remember liking it when I used
it ~1 year ago. It seems that it has pretty good warnings for regular
expressions.

Patch 0001 changes simplifies '[A-Z][A-Z]*' to '[A-Z]+'. I'm not sure
if this was intentional to match gnulib-tool.sh better though:

    's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \

Patch 0002 removes some redundant backslashing. I am pretty sure most
of these were introduced by me. We don't need to backslash ']' when it
is the first character in the '[...]' set. And in the set the special
characters have their special meaning dropped, so there is no need to
backslash them.

Collin

Attachment: 0001-gnulib-tool.py-Simplify-regular-expressions.patch
Description: Text Data

Attachment: 0002-gnulib-tool.py-Remove-redundant-backslashes-from-reg.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]