Hi,
I had a problem with a rather complex regex expression that didn't return
the same results in 1.1 and 2.0. I first thought that I could make a
utility assambly that referenced the 1.1 version of mscorlib and the use
that from the 2.0 application. But that didn't work so I drew the
conclusion that the problem was the runtime. That was wrong. I've compiled
the regular expression in 1.1 into a physical assembly using
Regex.CompileToAssembly and it works fine when referenced from the 2.0
application. The problem seems to be the actual parsing of the regular
expression in 2.0.
I don't know what goes wrong, but I now have a working workaround so I'll
let it drop. Now I'm just wondering if somebody at Microsoft would like to
pick it up to ferret out the possible cause.
Pattern (IgnorePatternWhitespace):
(?<list>
\[
(?>
([^[]|[]])+
|
\[ (?<DEPTH>)
|
\] (?<-DEPTH>)
)*
(?(DEPTH)(?!))
\]
)
|
(?<structure>
\w*\(
(?>
[^()]+
|
\( (?<DEPTH>)
|
\) (?<-DEPTH>)
)*
(?(DEPTH)(?!))
\)
)
|
('(?<quot>
[\w]*
)')
|
(?<variable>
[A-ZÅÄÖ]\w*
)
|
(?<value>
[a-zåäö]\w*
)
Input:
value,Var,[L1,L2,[L3,L4]],'Text',p(a,b)
Desired result (one row per match in Matches):
"value" in capture group 'value'
"Var" in capture group 'variable'
"[L1,L2,[L3,L4]]" in capture group 'list'
"'Text'" in capture group 'quot'
"p(a,b)" in capture group 'structure'
/Hugo