Skip to content

Instantly share code, notes, and snippets.

@OmegaExtern
Last active April 30, 2016 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OmegaExtern/9aa56d08414eb0c0f8cef1c281cb7095 to your computer and use it in GitHub Desktop.
Save OmegaExtern/9aa56d08414eb0c0f8cef1c281cb7095 to your computer and use it in GitHub Desktop.
What would the regex be to match all lines starting with "(spaces).method" until "cil managed(new line/spaces){"
.class public abstract auto ansi sealed beforefieldinit ExportedLibrary.ExportedClass
extends [mscorlib]System.Object
{
.method public hidebysig static int32 ExportedFunction1(int32 a,
int32 b) cil managed
{
.custom instance void [System.Runtime.InteropServices.DllExportAttribute]System.Runtime.InteropServices.DllExportAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention,
string)
= {int32(1)
string('ExportedFunction1')}
// Code size 4 (0x4)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: add
IL_0003: ret
} // end of method ExportedClass::ExportedFunction1
.method public hidebysig static int
ExportedFunction2(int32 a,
int32 b) cil managed
{
.custom instance void [System.Runtime.InteropServices.DllExportAttribute]System.Runtime.InteropServices.DllExportAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention,
string)
= {int32(5)
string('ExportedFunction2')}
// Code size 4 (0x4)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: add
IL_0003: ret
} // end of method ExportedClass::ExportedFunction2
.method public hidebysig static void ExportedFunction3(uint32 x) cil managed
{
.custom instance void [System.Runtime.InteropServices.DllExportAttribute]System.Runtime.InteropServices.DllExportAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention,
string)
= {int32(2)
string('ExportedFunction3')}
// Code size 28 (0x1c)
.maxstack 8
IL_0000: call class [mscorlib]System.IO.TextWriter [mscorlib]System.Console::get_Out()
IL_0005: ldstr "Passed: "
IL_000a: ldarg.0
IL_000b: box [mscorlib]System.UInt32
IL_0010: call string [mscorlib]System.String::Concat(object,
object)
IL_0015: callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string)
IL_001a: nop
IL_001b: ret
} // end of method ExportedClass::ExportedFunction3
.method public hidebysig static int32
ExportedFunction4(int32 a,
int32 b) cil managed
{
.custom instance void [System.Runtime.InteropServices.DllExportAttribute]System.Runtime.InteropServices.DllExportAttribute::.ctor(string,
valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention)
= {string('NewExportedFunctionName')
int32(1)}
// Code size 4 (0x4)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: add
IL_0003: ret
} // end of method ExportedClass::ExportedFunction4
.method public hidebysig static int32 ExportedFunction5(int32 a,
int32 b) cil managed
{
.custom instance void [System.Runtime.InteropServices.DllExportAttribute]System.Runtime.InteropServices.DllExportAttribute::.ctor(string,
valuetype [mscorlib]System.Runtime.InteropServices.CallingConvention)
= {string('SecondaryExportedFunction')
int32(4)}
// Code size 4 (0x4)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: add
IL_0003: ret
} // end of method ExportedClass::ExportedFunction5
} // end of class ExportedLibrary.ExportedClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment