Regex tricks: Difference between revisions
Jump to navigation
Jump to search
Amwelladmin (talk | contribs) No edit summary |
Amwelladmin (talk | contribs) No edit summary |
||
Line 25: | Line 25: | ||
#. Now your tags are all continuous blue strings. So brace them: | #. Now your tags are all continuous blue strings. So brace them: | ||
*Find: <(?{1,})> (use wildcards, font colour: blue) | *Find: <(?{1,})> (use wildcards, font colour: blue) | ||
*Replace: {{wikitag|\1}} (font colour blue) | *Replace: <nowiki>{{wikitag|\1}}</nowiki> (font colour blue) | ||
Now restore spaces, apostrophes and dashes. | Now restore spaces, apostrophes and dashes. | ||
Mwah. | Mwah. |
Revision as of 13:27, 13 April 2018
Tagging everything coloured blue
- search and destroy
- double spaces
- Fields (ctrl-shift-F9)
- bookmarks - there's a cool macro for this:
Sub RemoveAllBookmarks() Dim objBookmark As bookmark For Each objBookmark In ActiveDocument.Bookmarks objBookmark.Delete Next End Sub
- . Clear out all blue dashes - replace them with xxx
- . Clear out all blue apostrophes - replace them with yyy
- . Clear ot all blue spaces - replace them with qqq (this won't do the ones either side of the blue phrase)
- Find: ([A-Z][a-z]{1,}) ([A-Z][a-z]{1,}) (use wildcards, font colour: blue)
- Replace: \1qqq/2
- . Now your tags are all continuous blue strings. So brace them:
- Find: <(?{1,})> (use wildcards, font colour: blue)
- Replace: {{wikitag|\1}} (font colour blue)
Now restore spaces, apostrophes and dashes.
Mwah.