Results 1 to 4 of 4

Thread: Emacs regexp-replace Help

Hybrid View

  1. #1

    Default 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:

    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.

  2. #2
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: Emacs regexp-replace Help

    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/o...ing-scripting/

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

  3. #3

    Default Re: Emacs regexp-replace Help

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

  4. #4
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: Emacs regexp-replace Help

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •