From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [BUG] in org-property-drawer-re? Date: Wed, 2 Oct 2013 13:05:47 +0200 Message-ID: <0A59AE22-E691-4319-9174-79761B4B025E@gmail.com> References: <87r4c4519w.fsf@gmail.com> <87li2ct2t3.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7759177A-B5B6-46C1-A273-29EBF6BE1454"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRKFj-00048T-Pj for emacs-orgmode@gnu.org; Wed, 02 Oct 2013 07:06:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRKFb-0002C6-C3 for emacs-orgmode@gnu.org; Wed, 02 Oct 2013 07:05:59 -0400 Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:35880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRKFb-0002Bz-50 for emacs-orgmode@gnu.org; Wed, 02 Oct 2013 07:05:51 -0400 Received: by mail-ee0-f42.google.com with SMTP id b45so313411eek.1 for ; Wed, 02 Oct 2013 04:05:50 -0700 (PDT) In-Reply-To: <87li2ct2t3.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Thorsten Jolitz --Apple-Mail=_7759177A-B5B6-46C1-A273-29EBF6BE1454 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Oct 2, 2013, at 11:55 AM, Nicolas Goaziou = wrote: > Hello, >=20 > Carsten Dominik writes: >=20 >> This is just a cheep way to match any character at all, because \000 = should >> not be part of any string (in C it indicates the end of a string). >> In principle you could put any character you are sure will not turn = up, >> but \000 seems to be the safest choice. It is >> faster (I think) than "\\(.\\|\n\\)*" because the first will >> just run fast and streight with a table lookup while the >> latter need to always alternate between two alternatives. >> I have not timed it, though. >=20 > On that topic, I would add that "^\000" must be used with care, as it > can lead to a stack overflow in regexp matcher error quite easily. In > particular, it may be safe to use it to match a property drawer, which > will not be very large, but I think it's wrong to use it to match > regular blocks or drawers, which can have arbitrary long size. >=20 > For example a regexp like "[^\000]\\." will fail when matching around > 500 lines (72 characters long). Of course, constructs like > "\\(.\\|\n\\)*\\." will also fail, but my point is that it is tempting > to use "^\000" even though a regexp may not be the correct answer to = the > problem. Yes, I agree. This is why the real matching Org does is first looking = for a begin line, and then for the END line, in two independent searches. Much better and safer. - Carsten --Apple-Mail=_7759177A-B5B6-46C1-A273-29EBF6BE1454 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJSS/4LAAoJEO+gg/nAZuwMO38IAKTrLZMvPTe3qKKN5D5bseCL CuPvyvpvsqlhCVHoLHEoXXXaTwodSFKmTvPIOh+hgIbd1uI3Zbl3l7hB0iVXfwu+ 1DZvJqCYPvzZIMm2K0bvWNUjWYetgHVQudgu0JhZEbaRfPwd4MEn9fHBUlKcnEz+ Z7eIc02KfKh4lsSK9ZEhN814qOJUGsWvBLr5ohBLYlzxr5pnuFFT6qjbgqWJPUx5 fCxWnYa47oi6gL8vH130fI6NQsYgGu1k57O08aiYvUjg7LRIY4agiVUiSoc3FF4D x813SGcwmoHJkbHJYM8Utt5OkMl7uPr0GvwkjQ7+3amPRaXXH666mNpAw6xgky8= =0w65 -----END PGP SIGNATURE----- --Apple-Mail=_7759177A-B5B6-46C1-A273-29EBF6BE1454--