git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 12, 2018, 07:57 UTC
Message-ID
<nycvar.QRO.7.76.6.1810120955090.45@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqq7eiuwsm7.fsf@gitster-ct.c.googlers.com>
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

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 9 in “[Outreachy] git/userdiff.c fix regex pattern error”
  1. [Outreachy] git/userdiff.c fix regex pattern errorAnanya Krishna Maram, Oct 4, 2018
  2. Johannes SchindelinOct 4, 2018
  3. Ananya Krishna MaramOct 4, 2018
  4. Johannes SchindelinOct 4, 2018
  5. Ananya Krishna MaramOct 4, 2018
  6. Johannes SchindelinOct 4, 2018
  7. Junio C HamanoOct 6, 2018
  8. Johannes SchindelinOct 12, 2018
  9. Junio C HamanoOct 12, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.