Using java, I am writting a script to anchor link an html bibliography. That is going
from: [1,2]
to: <a href="o100701.html#bib1">[1, 2]</a>
I think I have found the right regex expression: \[.*?\]
What I am having trouble with is writting the code that will retain the values inside the expression while surounding it with the link tags.
This is the most of I can think of
while(myScanner.hasNext())
{
line = myScanner.nextLine();
myMatcher = myPattern.matcher(line);
...
outputBufferedWritter.write(line+"\n");
}
The files aren't very large and there almost always less then 100 matches, so I don't care about performance.