Lets say I have this variable
myvar = "81"
And I want to search through the lines that has strings like this and get the word inside the quotations:
static public Register myReg1 = new Register("D4_STAT_1", 81);
static public Register myReg2 = new Register("D5_STAT_1", 819);
In this case if I want to find the “D4_STAT_1”, by searching for myvar in the file, I know how to read each line, but the problem for me is how to search for a variable and get exactly the word inside the quotations.
Thanks.
Depending on the circumstances (the input file), you can also use a simpler: