Hi,
I've been trying to get a pattern to work, I'm almost at it, but still not yet.
Basically what I want the pattern to do is find from all function header to the "End function" and I will later change the pattern when this one work to make it find only the functions for which i will need to change some stuff
Basically, declaring datasets, datatables, and other disposable items withough disposing them in the "Finally" of the "Try"
I have one that works, but doesn't quite do what i want it to do, I'll explain the problem after.
^:b*(Public|Private) (Function|Procedure)(.*\n)*:b*End Function|Procedure
This one above does work, but in a file where i have 20 functions or procedures, it matches the first "(Public|Private):b(Function|Procedure)" to the last "End (Function|Procedure)".
What I want it to do is match only ONE function or procedure from its header to it's respective "End"
I tried the negative lookaround on the dot :
^:b*(Public|Private) (Function|Procedure)(.(?!End (Function|Procedure))*\n)*.*End (Function|Procedure)
It just doesn't match anything, I've tried about 25 different way to write the pattern but I just couldn't find one that matches what I wanted.
It would be easy if I could use the Lazy operator on my star, but unfortunately, i'm using the "Pattern Matching" of VB.NET 2003 ( When you press ctrl+f and check "Use regular expression" )
Can anyone help me find a pattern matching for this ?
I've been trying to get a pattern to work, I'm almost at it, but still not yet.
Basically what I want the pattern to do is find from all function header to the "End function" and I will later change the pattern when this one work to make it find only the functions for which i will need to change some stuff
Basically, declaring datasets, datatables, and other disposable items withough disposing them in the "Finally" of the "Try"
I have one that works, but doesn't quite do what i want it to do, I'll explain the problem after.
^:b*(Public|Private) (Function|Procedure)(.*\n)*:b*End Function|Procedure
This one above does work, but in a file where i have 20 functions or procedures, it matches the first "(Public|Private):b(Function|Procedure)" to the last "End (Function|Procedure)".
What I want it to do is match only ONE function or procedure from its header to it's respective "End"
I tried the negative lookaround on the dot :
^:b*(Public|Private) (Function|Procedure)(.(?!End (Function|Procedure))*\n)*.*End (Function|Procedure)
It just doesn't match anything, I've tried about 25 different way to write the pattern but I just couldn't find one that matches what I wanted.
It would be easy if I could use the Lazy operator on my star, but unfortunately, i'm using the "Pattern Matching" of VB.NET 2003 ( When you press ctrl+f and check "Use regular expression" )
Can anyone help me find a pattern matching for this ?