D
Don
I've created a regular expression to match everything from the word "const"
to the end of the last line that doesn't end in a space-underscore
characters.
i.e.
\sConst\s(.*)\sAs\s*String\s*=(.*\s_\n)*(.*\n)
applied to:
Friend const foo as string = "line1" & _
" line2" & _
" line3" & _
" line4" _
& " line5" & _
" end"
Friend const...
gives me:
const foo as string = "line1" & _
" line2" & _
" line3" & _
" line4" _
& " line5" & _
" end"
This works in the Regex Coach program I used to help me build the
expression, but when I bring this over to VB.NET, it only matches this:
"goodbye" & _
(with a hard return at the end)
Is there something wrong with the Regex Coach program in that is is
improperly executing my regular expression, or is VB.NET doing something
wrong?
Oh, and here's the code snippet that is retrieving the collection of Match
objects:
matches = Regex.Matches(sourceString, EXPRESSION, _
RegexOptions.IgnoreCase Or RegexOptions.Compiled)
(sourceString is the string I'm processing, and EXPRESSION is the
regular expression as listed above)
- Don
to the end of the last line that doesn't end in a space-underscore
characters.
i.e.
\sConst\s(.*)\sAs\s*String\s*=(.*\s_\n)*(.*\n)
applied to:
Friend const foo as string = "line1" & _
" line2" & _
" line3" & _
" line4" _
& " line5" & _
" end"
Friend const...
gives me:
const foo as string = "line1" & _
" line2" & _
" line3" & _
" line4" _
& " line5" & _
" end"
This works in the Regex Coach program I used to help me build the
expression, but when I bring this over to VB.NET, it only matches this:
"goodbye" & _
(with a hard return at the end)
Is there something wrong with the Regex Coach program in that is is
improperly executing my regular expression, or is VB.NET doing something
wrong?
Oh, and here's the code snippet that is retrieving the collection of Match
objects:
matches = Regex.Matches(sourceString, EXPRESSION, _
RegexOptions.IgnoreCase Or RegexOptions.Compiled)
(sourceString is the string I'm processing, and EXPRESSION is the
regular expression as listed above)
- Don