Thanks Demiz.


On Thu, May 10, 2012 at 9:56 PM, Deniz Dogan <deniz@dogan.se> wrote:
On 2012-05-10 11:37, shirish wrote:
Hi,

I am in the process of learning how to use emacs. I know about the
replace-regexp but I am unable to create a regular expression to do the
below.
Any help is much appreciated.

public static final String SUCCESS //Successmesg
public static final String FAILURE  //failuremessage

I need to replace that with

public static final String SUCCESS = "SUCCESS";//Successmesg
public static final String FAILURE  = "FAILURE"; //failuremessage

Thanks,
Shirish.



There are a lot of ways to do it.  One could be:

String \([^ ]+\)

and replace it with:

String \1 = "\1"

I would personally use keyboard macros for it.

I hope that helps,
Deniz