help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: multiline regex mode?


From: Michaël Cadilhac
Subject: Re: multiline regex mode?
Date: Mon, 16 Oct 2006 13:24:46 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Giles Chamberlin <giles.chamberlin@tandberg.net> writes:

> [snip] regex to match {foo} and {\nfoo\n}
>
> Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>
>> Does this (between the "")
>>
>> "{[^}]*}"
>>
>> work for you?  
>
> That works but I' don't understand why given that {.*} fails.  Any
> enlightenment gratefully received!

This is because of the following (from M-x info m elisp):

`.' (Period)
     is a special character that matches any single character except a
     newline.

`[^ ... ]'
     A complemented character alternative can match a newline, unless
     newline is mentioned as one of the characters not to match.  This
     is in contrast to the handling of regexps in programs such as
     `grep'.

-- 
/!\ My mail address changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac   |  Ajoutez du whisky                     |
 |         Epita/LRDE Promo 2007   |           à n'importe quel texte,      |
 |  http://michael.cadilhac.name   |    ça vous fera un beau pangramme.     |
 `--  -   JID: micha@amessage.be --'          -- Michel Clavel         -  --'

Attachment: pgpbt4JHaEoRK.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]