Re: [PATCH] [Outreachy] git/userdiff.c fix regex pattern error

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

 



Hi Junio,

On Sun, 7 Oct 2018, Junio C Hamano wrote:

> And then there is an unnamed misdesigned language that has a
> regmatch() function, which takes a string that contains a regular
> expression, but somehow requires that string to begin and end with a
> slash for no justifiable reason ;-).

It makes more sense once you realize that /<regexp>/ is a very nice
syntactic construct to obtain an instance of a regular expression object,
rather than a string describing one.

In Perl it is not as obvious as in Javascript.

But in C, we do not have objects, so the way to describe a regular
expression is a string (which you have to compile into an opaque data
structure before applying it).

Ciao,
Johannes



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux