H
Hugo Wetterberg
Hi,
I've got a problem with RegEx in the 2.0 Beta. I have a regexp expression
that works fine in the 1.1 version of the framework but breaks in 2.0. I'm
no regexp guru, so I don't really know why version 2.0 returns incorrect
results.
I have this string:
value,Var,[L1,L2,[L3,L4]],'Text',[L1,L2,L3],pro(a,b,c)
And I use this regexp pattern:
(?<list>\[(?>([^[]|[]])+
|
\[ (?<DEPTH>)
|
\] (?<-DEPTH>)
)*
(?(DEPTH)(?!))\])
|
(?<structure>\w*\((?>
[^()]+
|
\( (?<DEPTH>)
|
\) (?<-DEPTH>)
)*
(?(DEPTH)(?!))\))
|
('(?<quot>[\w]*)')
|
(?<variable>[A-ZÅÄÖ]\w*)
|
(?<value>[a-zåäö]\w*)
....with the options RegexOptions.Compiled and
RegexOptions.IgnorePatternWhitespace.
These are the results. Only one capture group succeeds in each match.
Capture group - Captured value
In 1.1
value - value
variable - Var
list - [L1,L2,[L3,L4]]
quot - Text
list - [L1,L2,L3]
structure - pro(a,b,c)
In 2.0
value - value
variable - Var
variable - L1
variable - L2
variable - L3
variable - L4
quot - Text
variable - L1
variable - L2
variable - L3
structure - pro(a,b,c)
I hope that you can help with this. Sorry for cross posting, follow up to
microsoft.public.dotnet.framework.
/Hugo
I've got a problem with RegEx in the 2.0 Beta. I have a regexp expression
that works fine in the 1.1 version of the framework but breaks in 2.0. I'm
no regexp guru, so I don't really know why version 2.0 returns incorrect
results.
I have this string:
value,Var,[L1,L2,[L3,L4]],'Text',[L1,L2,L3],pro(a,b,c)
And I use this regexp pattern:
(?<list>\[(?>([^[]|[]])+
|
\[ (?<DEPTH>)
|
\] (?<-DEPTH>)
)*
(?(DEPTH)(?!))\])
|
(?<structure>\w*\((?>
[^()]+
|
\( (?<DEPTH>)
|
\) (?<-DEPTH>)
)*
(?(DEPTH)(?!))\))
|
('(?<quot>[\w]*)')
|
(?<variable>[A-ZÅÄÖ]\w*)
|
(?<value>[a-zåäö]\w*)
....with the options RegexOptions.Compiled and
RegexOptions.IgnorePatternWhitespace.
These are the results. Only one capture group succeeds in each match.
Capture group - Captured value
In 1.1
value - value
variable - Var
list - [L1,L2,[L3,L4]]
quot - Text
list - [L1,L2,L3]
structure - pro(a,b,c)
In 2.0
value - value
variable - Var
variable - L1
variable - L2
variable - L3
variable - L4
quot - Text
variable - L1
variable - L2
variable - L3
structure - pro(a,b,c)
I hope that you can help with this. Sorry for cross posting, follow up to
microsoft.public.dotnet.framework.
/Hugo