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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -