Hi Bruno,

On 3/10/24 3:51 PM, Bruno Haible wrote:
> I prefer comparing with '' explicitly. It's clearer about the intent.
> It avoids an implicit conversion from str to bool.

Sure, makes sense. I'll keep that in mind in the future.

> Regarding the regex change: In a group '(...)' one needs to use '|' to
> indicate different alternatives. Whereas in a character set, alternation
> is already implicit:   '[xyz]' is the same as '([x]|[y]|[z])' or '(x|y|z)'.

Ah, thank you for the explanation! In the patch for part 52, I was
wondering about this when looking at the regular expression to check
for 'subdir-objects' AM_INIT_AUTOMAKE.

Most of my knowledge of regular expressions is from a course I took in
college called Formal Languages & Computability. Very interesting
class, but the regular expression syntax was simple and the focus was
much more on the regular language being represented by the regular
expression.

The POSIX BRE vs. ERE along with backreferences, assertions, lazy vs.
greedy matching allowed by some languages adds multiple layers of
complexity which starts to hurt my brain. :)

I just noticed that gnulib has documentation for a lot of the
different regular expression syntaxes used by different languages and
GNU programs. I'll have a look at that in the future. The DFA module
also looks pretty interesting to me.

Collin

Reply via email to