gnu-regexp-users
[Top][All Lists]
Advanced

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

[Regexp] Regexp to match a number...


From: Giuseppe Greco
Subject: [Regexp] Regexp to match a number...
Date: 26 Feb 2003 21:00:50 +0100

Hi volks,

I've a file that contains some lines like these

...
pool_size.latex = 50000  # some comments here
hash_extra.latex = 25000 # some other comments here
...

I need to change the numerical values (50000 and 25000)
by keeping the rest of the text (before and after the
number) as it is.

Actually, I'm using the regexp /[0-9]*[0-9]/ and it
more or less works... I say more ore less because if I
have a line like

another_line = 5abc5 # comment ...

the string 5abc5 is also replaced, but I want to change
full numerical values only.

Which regexp could I use to accomplish that? What's
important is that the text before and after the number
is kept as it is.

Thanks,

-- 
Giuseppe Greco
Agamura Corporation
Strada Regina 40
6928 Manno
Switzerland

Phone:  +41 (0)91 604 67 65
Mobile: +41 (0)76 390 60 32
Email:  address@hidden





reply via email to

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