Re: regex help

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: JT Moree
Date:  
To: Main PLUG discussion list
Subject: Re: regex help
Matrix Mole wrote:
> {some text} /home/matrixm {more text} /home/matrixm {even more text}
>
> and I want to add onto the path of the second path so that instead it
> looks like this:
>
> {some text} /home/matrixm {more text} /home/matrixm/tmp {even more text}
>
> I know that a switch command can do it
> (s:/home/matrixm:/home/matrixm/tmp:) but I don't know how to force regex
> to only work on the second occurrence of the pattern match.


in perl it would be done like this

s|^(.*)/home/matrixm(.*)/home/matrixm(.*)$|$1/home/matrixm$2/home/matrixm$3|


- --
JT Morée
PC Xperience, Inc.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss