:%s/[.@/]\@<!\(\<\w*\>\)\(@\|\.\w\|:\/\)\@!/\u\1/g

:%s/.*/\L&/g
konvertiert den Bufferinhalt nach Kleinschrift. Die bearbeitete Datei kannte diese aus historischen Gründen nicht.
:%s/[.@/]\@<!\(\<\w*\>\)\(@\|\.\w\|:\/\)\@!/\u\1/g
bringt allen Wörtern, die nicht Teil einer E-Mail-Adresse oder URL sind, Gro??schreibung bei (das Leerzeichen gehört übrigens nicht in die Zeile, sondern erscheint dort durch einen Bug von WordPress). Es mu?? ja nicht immer perl sein. :)
Bei Texten die Umlaute enthalten, sollte man übrigens das \w besser durch ein \(\w\|[äöü??]\) ersetzen.
Vim kann sehr praktisch sein.
Und wenn ich das nächste mal so etwas mache, schaue ich einfach in mein Blog. ;)
Ein Blog kann sehr praktisch sein.

4 Responses to “:%s/[.@/]\@<!\(\<\w*\>\)\(@\|\.\w\|:\/\)\@!/\u\1/g”

  1. Dave Says:

    Ich weiss nicht, ob das Leerzeichen ein WordPress Bug ist. Spitze Klammern k?nnen HTML rendering leicht st?ren. Tipp: Pack die Zeichenfolge mal in eine CDATA section und schau, ob das Leerzeichen verschwindet.

  2. Blogf?hrer Says:

    Update 2: Das Problem mit dem Parsen ist nach dem WordPress-Upgrade offenbar behoben. Ein kleines Problemchen beim Editieren dieses Kommentars war, da? sich die Backslashes auf wundersame Weise vervielf?ltigten, wie man unten sieht, aber, was will man machen…

    Update: mittlerweile wird auch der Backslash geparsed, ich habe das Post und diesen Kommentar entsprechen geupdated entsprechend geupdated sowie die Orignalfassung unten als Zitat eingef?gt.

    Meinst Du das:

    < ![CDATA[:%s/[.@/]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\@\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\(@\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\.\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\w\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\@!/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\u\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\1/g]]>

    Nun, das Leerzeichen erscheint an anderer Stelle, wie CDATA und andere Sachen, die Du selber siehst, daf?r verschwinden einige wichtige Zeichen…
    Zum Vergleich noch einmal die WordPress-Interpretation des oben dargestellten Strings: aus

    :%s/[.@/]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\@< !\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\\\\\\\\\\\\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\@!/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\u\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\1/g
  3. Dave Says:

    Tja, sieht so aus, als ob die CDATA section nicht als solche durch den Template Mechanismus von WordPress kommt. Vielleicht gibt es ja in der neuen Version eine L?sung daf?r?

  4. Blogf?hrer Says:

    Ja, s. o.!