[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How modify numbers in a region by a multiplier?
From: |
Juanma Barranquero |
Subject: |
Re: How modify numbers in a region by a multiplier? |
Date: |
Thu, 1 Jul 2010 17:56:51 +0200 |
On Thu, Jul 1, 2010 at 16:31, Seweryn Kokot <sewkokot@gmail.com> wrote:
> But why my function does not work since re-search-forward
> and replace-match is recommended in lisp functions?
The regexp you use to match the numbers
"\\([0-9]*\\.?[0-9]*\\)"
matches also the empty string, so after 33.444 it matches on "" and
generates .000, and then matches again on "" and generates another
.000, etc.
I just used "\\([0-9.]+\\)", which is less precise (it'll match
"1..2", ".", ".3.", etc.), but for quick-and-dirty jobs is enough.
You'll have to fix your regexp, or move point one character forward if
you matched the empty string.
Juanma
- How modify numbers in a region by a multiplier?, Seweryn Kokot, 2010/07/01
- Re: How modify numbers in a region by a multiplier?, Juanma Barranquero, 2010/07/01
- Re: How modify numbers in a region by a multiplier?, Seweryn Kokot, 2010/07/01
- Re: How modify numbers in a region by a multiplier?,
Juanma Barranquero <=
- Re: How modify numbers in a region by a multiplier?, Seweryn Kokot, 2010/07/01
- Re: How modify numbers in a region by a multiplier?, Juanma Barranquero, 2010/07/01
- Re: How modify numbers in a region by a multiplier?, Seweryn Kokot, 2010/07/01
- Re: How modify numbers in a region by a multiplier?, Juanma Barranquero, 2010/07/01
- Re: How modify numbers in a region by a multiplier?, Seweryn Kokot, 2010/07/02
- Re: How modify numbers in a region by a multiplier?, Juanma Barranquero, 2010/07/02
- Re: How modify numbers in a region by a multiplier?, Seweryn Kokot, 2010/07/02
- Re: How modify numbers in a region by a multiplier?, Juanma Barranquero, 2010/07/02
- Re: How modify numbers in a region by a multiplier?, Štěpán Němec, 2010/07/02
- Re: How modify numbers in a region by a multiplier?, Juanma Barranquero, 2010/07/02