Title |
Test
Find
Pattern Title
|
Expression |
^(?<Code>([^"']|"[^"]*")*)'(?<Comment>.*)$ |
Description |
This expression separates a Visual Basic (VB) source code line into the code part and the comment part (if any, following an apostrophe character not enclosed in quote marks). |
Matches |
a = b ' Comment | a = "xy'z" ' Comment |
Non-Matches |
a = b | rem not supported |
Author |
Rating:
Not yet rated.
Robert Altman
|
Source |
Based on an expression posted on MS newsgroup microsoft.public.dotnet.framework by Mark Hurd, B.Sc.(Ma.) (Hons.) |
Your Rating |
|
Title: One case that does not work
Name: Chris Strolia-Davis
Date: 11/26/2004 3:14:47 PM
Comment:
Note: Multiline must be on for expression to work.
In the following case, the comment and code are interpreted as being on the same line:
Sub MySub(optional x as string = "There is no ' comment in this line")
' This is a comment line