Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

replace

8 views
Skip to first unread message

Zak

unread,
Aug 16, 2011, 8:00:16 AM8/16/11
to
hi,
i'm trying to search and replace a typical expression in a file such
as

\{student "7+9"\} with "7+9"

there are multiple instances in the file of \{student * \} and i want
to search and replace everything found with what the regexp wildcard
represents. I have tried this

s/\(\\{student\) \(*\) \(\\}\)/\2/g

to no avail,
Zak

Andreas Perstinger

unread,
Aug 21, 2011, 3:33:27 AM8/21/11
to
On 2011-08-16 14:00, Zak wrote:
> there are multiple instances in the file of \{student * \} and i want
> to search and replace everything found with what the regexp wildcard
> represents. I have tried this
>
> s/\(\\{student\) \(*\) \(\\}\)/\2/g
>
> to no avail,


Does

s/\\\{student \([^\]*\)\\\}/\1/g

work for your file?

Bye, Andreas

0 new messages