all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Bonow <thorsten.bonow@withouthat.org>
To: help-gnu-emacs@gnu.org
Subject: regexp question
Date: Thu, 06 Jan 2011 17:14:59 +0100	[thread overview]
Message-ID: <87d3oaf1q4.fsf@withouthat.org> (raw)


Hi,

I wrote the following defun:

(defun yyy-rmligs()
"Function to call `query-replace-regexp' and search
for words, ignoring LaTeX commands starting with a backslash,
which contain ligatures 'ff', 'fi', 'fl', 'ffi' and 'ffl' and
queries about replacing them with their LaTeX non-ligature
variant.  E.g. 'shelfful' could be replaced by 'shelf\"|ful',
while '\\flushright' is ignored."

  (interactive)
  (query-replace-regexp
   "\\([^\\\\]\\b\\w*\\)f\\(f\\|i\\|l\\|fi\\|fl\\)\\(\\w*\\b\\)"
   "\\1f\"|\\2\\3)"))

It works, unless there is more then one ligature in the word.

I can replace 'aaaflaaa' with 'aaaf"|laaa', but the defun fails to replace the
first occurrences of 'fl' in 'aaaflaaaflaaa'.

Help on the rexeps involved would be appreciated. Thx!

Toto

PS: Yes I know of the rmligs program; my need is for other languages than
    German.

    I know that for LaTeX documents I should (and will) use
    `reftex-query-replace-document' instead of `query-replace-regexp'.

    Do words in the English language exist which have more than one ligature?

-- 
"A Korean newspaper wrote that Aachen University is the MIT of Europe."
Burkhard Rauhut / "Anything that's the something of something isn't
really the anything of anything." Lisa Simpson



             reply	other threads:[~2011-01-06 16:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 16:14 Thorsten Bonow [this message]
2011-01-07 10:05 ` regexp question tomas
  -- strict thread matches above, loose matches on Subject: below --
2006-09-26 11:18 AW: replace a textblock in multiple files C.Strobl
2006-09-26 12:09 ` regexp question C.Strobl
2006-09-26 17:16   ` Peter Dyballa
2006-09-29 22:03     ` Dieter Wilhelm
2006-09-30  8:53       ` Peter Dyballa
     [not found] ` <mailman.7422.1159272599.9609.help-gnu-emacs@gnu.org>
2006-09-27  7:58   ` Florian Kaufmann
     [not found] <20040924194238.40080.qmail@web51606.mail.yahoo.com>
2004-09-28 18:21 ` RegExp question JayBingham
2004-09-23 20:23 JayBingham
2004-09-24 19:43 ` Ryan Bowman
     [not found] <mailman.3776.1095958718.1998.help-gnu-emacs@gnu.org>
2004-09-23 18:09 ` Stefan Monnier
2004-09-23 16:41 Ryan Bowman
2004-09-23 18:05 ` Greg Hill

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=87d3oaf1q4.fsf@withouthat.org \
    --to=thorsten.bonow@withouthat.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.