From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Interpret :/<pattern> as a regular expression
Date: Wed, 13 Jun 2007 23:20:43 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0706132317240.4059@racer.site> (raw)
In-Reply-To: <20070613200011.GA17360@coredump.intra.peff.net>
Hi,
On Wed, 13 Jun 2007, Jeff King wrote:
> On Wed, Jun 13, 2007 at 07:54:59PM +0100, Johannes Schindelin wrote:
>
> > :-) Since you seem comfortable with regular expressions, maybe you can
> > help me: I am looking for a pattern which matches _any_ character, and one
> > which matches only non-newlines, both with and without REG_NEWLINE. Hmm?
>
> Without REG_NEWLINE, any character is just '.', but I think you are
> stuck with '[^
> ]' for non-newlines, since POSIX makes no provisions for quoting the
> newline (I just skimmed through POSIX chapter 9, and I didn't see
> anything useful).
>
> With REG_NEWLINE, non-newlines is of course '.'. Matching both is tricky
> without using extended regular expressions (where you could just do '.|
> '). In fact, I have been playing with it for a few minutes and I can't
> seem to find a good way, since you really want to represent '.' _inside_
> a bracketed alternation sequence. But I don't think there's a character
> class for "everything".
>
> I think this would be much easier with pcre, but ISTR some opposition to
> that a few months back.
Actually, that's funny. Yesterday, I repeated my claim that pcre is
slow on IRC, and Sam Villain on IRC accused me of trolling. But as you can
see from my postings on this list ($gmane/41682), you can see that _I_ had
numbers to back up my claim.
So no, I think pcre is just not worth it.
> So that's probably not very helpful to you, but at least you have
> confirmation from one other person that the answer isn't totally
> obvious. :)
That confirmation is at least some consolation to me :-)
Ciao,
Dscho "who is not here to teach, but to learn"
next prev parent reply other threads:[~2007-06-13 22:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-13 0:50 [PATCH] Interpret :/<pattern> as a regular expression Johannes Schindelin
2007-06-13 1:21 ` Junio C Hamano
2007-06-13 13:13 ` Johannes Schindelin
2007-06-13 4:52 ` Junio C Hamano
2007-06-13 11:10 ` Johannes Schindelin
2007-06-13 11:17 ` (unknown) Johannes Schindelin
2007-06-13 12:11 ` [PATCH] Interpret :/<pattern> as a regular expression Johannes Schindelin
2007-06-13 18:41 ` Jeff King
2007-06-13 18:54 ` Johannes Schindelin
2007-06-13 20:00 ` Jeff King
2007-06-13 22:20 ` Johannes Schindelin [this message]
2007-06-14 7:48 ` Sam Vilain
2007-06-14 8:09 ` Johannes Schindelin
2007-06-14 9:07 ` Sam Vilain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0706132317240.4059@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).