473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Compiled Regex in 1.1 & 2.0

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
Nov 16 '05 #1
0 1046

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Shmulik | last post by:
How can I (can I?) use a regular expression as the filter to a FileSystemWatcher? I want to watch for something like this: Regex regex = new Regex(@"^Current(One|Two|Three)File\.txt$",...
7
by: bill tie | last post by:
I'd appreciate it if you could advise. 1. How do I replace "\" (backslash) with anything? 2. Suppose I want to replace (a) every occurrence of characters "a", "b", "c", "d" with "x", (b)...
2
by: John Grandy | last post by:
Is it advisable to compile a Regex for a massively scalable ASP.NET web-application ? How exactly does this work ? Do you create a separate class library and expose the Regex.Replace() as a...
20
by: jeevankodali | last post by:
Hi I have an .Net application which processes thousands of Xml nodes each day and for each node I am using around 30-40 Regex matches to see if they satisfy some conditions are not. These Regex...
14
by: ohmmega | last post by:
hy, i've got a simple question (for somebody who already knows the answer) about regex: i've a string like bla@bla@bla or bla@@bla i like to check the @'s, but couldn't figure it out how to set...
0
by: Wilson799799 | last post by:
Hello, I am searching for a way to match quotation marks (extended ascii characters 147 and 148) with a .net regex. I tried this regex += .... |" + System.Convert.ToChar(147) + "|" +...
3
by: Svinja | last post by:
Hi, I want to replace "\n" with "!" in c#, i tried this: String buffer=richTextBox.Text; buffer=buffer.Replace(@"\n", "!"); and it worked, but this didnt: String...
7
by: CSharper | last post by:
I have a situation where I have file with all the find and replace values, I read it and put it in a dictionary format. Next I have to read all the files in a given directory and read each line in...
6
by: | last post by:
Hi all, Sorry for the lengthy post but as I learned I should post concise-and-complete code. So the code belows shows that the execution of ValidateAddress consumes a lot of time. In the test...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.