I have a piece of generated text on Notepad++ that I would like to make some find/replace with Regex...
The text originally is like this:
private static final int ClientCode(removingQuotes(fields[4]));
private static final int InvoiceDate(removingQuotes(fields[5]));
private static final int IssueDate(removingQuotes(fields[6]));
...
I want to change the (removingQuotes(fields[6]))
of each line and replacing to = n
- where n is the number inside square brackets.
In the end, the result would be like this:
private static final int SeqNum = 2;
private static final int CarSegNum = 3;
I already have a regular expression that matches (removingQuotes(fields[6]))
. The regex I have is below:
\(removingQuotes\(fields\[\d+\]\)\)
However, I don't know what to place in the Replace with: field, in order to get the number from the previous string and keep it. Today I need to change the number for each occurrence - and I have thousands of lines to do it.
Is there a way to do it?
(removingQuotes(fields[
with ` = ` and replace]))
with[null]