Re: OT: matched string of a regular expression
On Wed, Mar 04, 2009 at 16:24:27 -0500, kamaraju kusumanchi wrote:
[...]
> Now,
> I would like to replace all the occurrences of
>
> a(ijk)1b with a(ijk)23b
> a(jik)1b with a(jik)23b
> a(ikj)1b with a(ikj)23b
> and so on for all the strings such as a(???)
>
> Because of the size of the files involved, the number of files on
> which I have to perform this operation I decided to use sed (instead
> of doing it manually in vim)
[...]
> Is there any way
> to write something like
>
> s/a(???)1b/a(???)23b/g
>
> where the second ??? is the string matched by the first regular
> expression.
sed -e 's/a(\(...\))1b/a(\1)23b/g'
--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |
Reply to: