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

Re: search/replace with regexp



You can use sed at the command line.
cat file|sed -e '[[/address/,]/toaddress/]s/this/that/'
address can either be a number like: cat /etc/passwd|sed -e '1s/root/toor/'
or a regex it self like: cat /etc/passwd|sed -e '/^.oot/,/bin/s/tcsh/bash/'
you can add g after the last / for global substitutions, i.e
same word multiple times on one line.

Ben-Nes Michael <miki@canaan.co.il> wrote:
> Hi All
> 
> Any one know about good search/replace (text) that accept regexp as pattern
> ?
> 
> the one that im using is rpl (great) but it does not support regexp :(
> 
> --------------------------
> Canaan Surfing Ltd.
> Internet Service Providers
> Ben-Nes Michael - Manager
> Tel: 972-4-6991122
> http://sites.canaan.co.il
> --------------------------
> 
> 
> 
> =================================================================
> To unsubscribe, send mail to linux-il-request@linux.org.il with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail linux-il-request@linux.org.il

-- 
http://www.rshell.org
Join #shellcode on EFnet.
rasta@rshell.org

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il