Emacs regexp-replace Help

I have a number of lines that get output from a program that I would like to manipulate using Emacs, but despite reading tons of documentation, etc. I still cannot figure out how to do what I need to do. I have lines like this:


garbage_stuff mrnbsfjsfgnl (IMPORTANT INFO) garbage_stuff fojnlksjni (IMPORTANT INFO) more_garbage

I would like to keep only the info inside of the parentheses and remove the rest.

Also is there a way to replace a string using a wildcard char like in the bash shell say:


replace 'garbage_*(' with ' '

in order to get rid of the junk I don’t need?

Any help is much appreciated.

gforce6point0 wrote:
>
> I have a number of lines that get output from a program that I would
> like to manipulate using Emacs, but despite reading tons of
> documentation, etc. I still cannot figure out how to do what I need to
> do. I have lines like this:
>
>
> Code:
> --------------------
>
> garbage_stuff mrnbsfjsfgnl (IMPORTANT INFO) garbage_stuff fojnlksjni (IMPORTANT INFO) more_garbage
>
> --------------------
>
>
> I would like to keep only the info inside of the parentheses and remove
> the rest.
>
> Also is there a way to replace a string using a wildcard char like in
> the bash shell say:
>
>
> Code:
> --------------------
>
> replace ‘garbage_*(’ with ’ ’
>
> --------------------
>
>
> in order to get rid of the junk I don’t need?
>
> Any help is much appreciated.
>
>
This question should ideally go into

Forum: Programming/Scripting

Questions about programming, bash scripts, perl, php, cron jobs, ruby,
python, etc.

Home>Forum>English>Other Forums>Development>Programming/Scripting

http://forums.opensuse.org/english/other-forums/development/programming-scripting/


GNOME 3.6.2
openSUSE Release 12.3 (Dartmouth) 64-bit
Kernel Linux 3.7.10-1.16-desktop

Alright, can I move it or does an admin need to do so?

gforce6point0 wrote:
>
> Alright, can I move it or does an admin need to do so?
>
>
You can press the dark triangle at the bottom of each post and ask the
admins to move the thread.


GNOME 3.6.2
openSUSE Release 12.3 (Dartmouth) 64-bit
Kernel Linux 3.7.10-1.16-desktop