Replace bibtex or latex {\dg} string command in java -


i want write parser bibtex file. in bibtex-file there string booktitle = {wohnen - pflege - teilhabe {\dq}besser leben durch technik{\dq}} . anyway, using junit-tests , method should detect , replace {\dg} ' or ". unfortunately not able write corresponding java code, example following code did not detect substring?

inproceedingscitation1 += " booktitle = {wohnen - pflege - teilhabe {\\dq}besser leben durch technik{\\dq}},\n"; 

corresponding part of replace-method:

string afterdg = ""; charsequence targetdg = "{\\dg}"; charsequence replacementdg = "\""; afterdg = afterae.replace(targetdg, replacementdg);  

this regular expression should solve problem:

string afterdg = afterae.replaceall("\\{\\\\dq\\}", "\"");

for more details according regular expressions, have @ vogellas java regex tutorial.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -