For a chronological index (http://ift.tt/1cH7kv5) I'd like to replace following entries (and many more of these types in my document), so that the (number, if present, plus) the first three alpha-letters is written in the first bracket. The second bracket has to start with a number,number and can be followed by something else. Examples:
\index[bibel]{Psalm!Psalm 102,26} => \bibelindex{Psa}{102,26}
\index[bibel]{1. Johannes!1. Johannes 4,16} => \bibelindex{1Joh}{4,16}
\index[bibel]{Offenbarung!Offenbarung 21,16b} => \bibelindex{Off}{21,16b}
\index[bibel]{Habakuk!Habakuk 3,17f.} => \bibelindex{Hab}{3,17f.}
\index[bibel]{Kolosser!Kolosser 4,3-6} => \bibelindex{Kol}{4,3-6}
\index[bibel]{1. Korinther!1. Korinther 15,20-28} => \bibelindex{1Kor}{15,20-28}
\index[bibel]{1. Korinther!1. Korinther 15,50.51} => \bibelindex{1Kor}{15,50.51}
\index[bibel]{Psalm!Psalm 2,2.7.9.17.19.23} => \bibelindex{Psa}{2,2.7.9.17.19.23}
\index[bibel]{Lukas!Lukas 21,11.16-19} => \bibelindex{Luk}{21,11.16-19}
\index[bibel]{Markus!Markus 24,35-37.40-43.45f.} => \bibelindex{Mar}{24,35-37.40-43.45f.}
Is it possible to use a single search pattern + single replace pattern with regular expression to replace all of the examples in one step?
Aucun commentaire:
Enregistrer un commentaire