Regex tricks: Difference between revisions

From The Jolly Contrarian
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
===Seach destroy===
/\{\{fullanat2\|isda\|([^]]*)\|2002\|[^]]*\|1992\}\}/ ==> {{isdaanat|$1}}
===Tagging everything coloured blue===
===Tagging everything coloured blue===
#search and destroy
#search and destroy

Revision as of 10:55, 18 January 2020

Seach destroy

/\{\{fullanat2\|isda\|([^]]*)\|2002\|[^]]*\|1992\}\}/ ==>

ISDA Anatomy™


In a Nutshell Section $1:

Template:Nutshell 2002 ISDA $1 view template

2002 ISDA full text of Section $1:

Template:ISDA Master Agreement 2002 $1 view template

Click here for the text of Section $1 in the 1992 ISDA

Index: Click to expand:Navigation
See ISDA Comparison for a comparison between the 1992 ISDA and the 2002 ISDA.
The Varieties of ISDA Experience
Subject 2002 (wikitext) 1992 (wikitext) 1987 (wikitext)
Preamble Pre Pre Pre
Interpretation 1 1 1
Obligns/Payment 2 2 2
Representations 3 3 3
Agreements 4 4 4
EODs & Term Events 5 Events of Default: FTPDBreachCSDMisrepDUSTCross DefaultBankruptcyMWA Termination Events: IllegalityFMTax EventTEUMCEUMATE 5 Events of Default: FTPDBreachCSDMisrepDUSTCross DefaultBankruptcyMWA Termination Events: IllegalityTax EventTEUMCEUMATE 5 Events of Default: FTPDBreachCSDMisrepDUSSCross DefaultBankruptcyMWA Termination Events: IllegalityTax EventTEUMCEUM
Early Termination 6 Early Termination: ET right on EODET right on TEEffect of DesignationCalculations; Payment DatePayments on ETSet-off 6 Early Termination: ET right on EODET right on TEEffect of DesignationCalculationsPayments on ETSet-off 6 Early Termination: ET right on EODET right on TEEffect of DesignationCalculationsPayments on ET
Transfer 7 7 7
Contractual Currency 8 8 8
Miscellaneous 9 9 9
Offices; Multibranch Parties 10 10 10
Expenses 11 11 11
Notices 12 12 12
Governing Law 13 13 13
Definitions 14 14 14
Schedule Schedule Schedule Schedule
Termination Provisions Part 1 Part 1 Part 1
Tax Representations Part 2 Part 2 Part 2
Documents for Delivery Part 3 Part 3 Part 3
Miscellaneous Part 4 Part 4 Part 4
Other Provisions Part 5 Part 5 Part 5
Tell me more
Sign up for our newsletter — or just get in touch: for ½ a weekly 🍺 you get to consult JC. Ask about it here.


Tagging everything coloured blue

  1. 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
  1. . Clear out all blue dashes - replace them with xxx
  2. . Clear out all blue apostrophes - replace them with yyy
  3. . 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
  1. . 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.

Indenting wikified autonumbering

  • In a word doc, make all your numbering reveal every level (eg “13(c)(vii)(B)” with the ferocity of a US securities lawyer. you can do this in the “Define Multilevel Lists” dialogue.
  • Copy your whole doc into a text-only email. It will faithfully convert all those numbers to text. You will lose the indenting. We will put it back.
  • Switch on Use wildcards in the replace dialogue.
  • Find: ^13([0-9]{1,}\([a-z,A-Z,0-9]{1,}\)\([a-z,A-Z,0-9]{1,}\)\([a-z,A-Z,0-9]{1,}\))
  • Replace: ^13:::\1

Then

  • Find: ^13([0-9]{1,}\([a-z,A-Z,0-9]{1,}\)\([a-z,A-Z,0-9]{1,}\))
  • Replace: ^13::\1

Then

  • Find: ^13([0-9]{1,}\([a-z,A-Z,0-9]{1,}\))
  • Replace: ^13:\1

Sorted.