Giles Chamberlin writes: > [snip] regex to match {foo} and {\nfoo\n} > > Dieter Wilhelm 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 - --'