You can't do it with pico unfortunately (that's my editor of choice as
well, because it's the first one I ever learned, but the functionality
pales in comparison with one like vi, which I can't use for crap :D)...
vi offers this type of functionality w/ regex search and replace, so you
could do this command (I tested it before I posted):

:%s/REMOVE_BIT(\s*\([^,?]*\)/remove_bit(\&\1/g

this will do a case-sensitive search and replace of the REMOVE_BIT
statements in favor of the new style, it will also strip out any spacing
between that opening parenthese and the text so that:

REMOVE_BIT(ch->act,PLR_QUESTING); or
REMOVE_BIT( ch->act,PLR_QUESTING); or
REMOVE_BIT(    ch->act,PLR_QUESTING);

Becomes

remove_bit(&ch->act,PLR_QUESTING);

and you don't accidentally wind up with something like this:

remove_bit(& ch->act,PLR_QUESTING);

Hope this helps :)

Richard Lindsey.

-----Original Message-----
From: Orlis Soilface [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 06, 2005 12:04 PM
To: [email protected]
Subject: regular expression search and replace

im planning on putting in runters infinite bits and was wondering if
this was possible. i only really use pico for editting in the shell so
havent had to much experience with something else although i did
search and try some things with no success. basically, im wondering if
this can be done:

find:
REMOVE_BIT(%1->act,PLR_QUESTING);
and replace with:
remove_bit(&%1->act,PLR_QUESTING);

ya know what i mean?
-- 
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to