Title |
Test
Find
Extract VBScript/VB code blocks
|
Expression |
(?<Code>[\s\S]*?)(?<NonCode>'.*?\r?\n|(?<quot>"|')(?:(?:(?!\<quot>).|\<quot>{2})*)(?:\<quot>)) |
Description |
This expression matches all VBScript or VB code. Line comments (with ') and strings are inlcuded in named groups. Strings with double quotes (i.e. "this is my ""string"".") is supported. Expression is only tested with RegEx for .net 2.0. |
Matches |
Response.Write "my ""quoted"" string" ' some comment |
Non-Matches |
.. |
Author |
Rating:
Torbjörn Hansson
|
Source |
|
Your Rating |
|
Title: Extract VBScript/VB code blocks
Name: Swakke
Date: 4/15/2011 9:11:32 AM
Comment:
Hello Hansson,
your expression is great but I have a problem with it.
When in a text le last comment (') - and also the last line - doesn't end with a CR/LF there is no match !!!
I hope i'm not wrong and how can we fix this ?
Thank you in advance for your reply.
Swakke