duplicating Java Class integer options to a string names

For testing a java library, I used different options of the class, which
are integers, to see the different results.

Therefore I used an array of the available options in a loop.
But for printing the result, I saw just the integer values and not the corresponding names.

int optionArray[] =
{
BarcodeDatamatrix.DM_AUTO,
BarcodeDatamatrix.DM_ASCII,
BarcodeDatamatrix.DM_C40,
BarcodeDatamatrix.DM_TEXT
};

So I used an array of strings representing the options.

The long lasting solution would be to copy the array and to manually the
replacement with strings.
The faster option within netbeans is to use regular expressions to change.
Copy the optionArray put the cursor before the array and use the "Edit" - "Replace" ( Short-Cut "Ctrl-H" )

In the dialog use:



Search for BarcodeDatamatrix.(.*),
Replace for "$1",

And the result is:


int optionStringArray[] =
{
"DM_AUTO",
"DM_ASCII",
"DM_C40",
"DM_TEXT"
};

When you have a lot of options this is much shorter than doing it the manual way.