473,511 Members | 15,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different Behavior of Regex in .net 1.1 and 2.0?

As below code, Regex.Replace() can trim the 2nd and 4th line of string
original.
string original = "\n0\t00000\t0\t0.123456\tEnglish\tabor"
+

"\n0\t00000\t0\t0.000000\tEnglish\tabor" +

"\n0\t00000\t0\t0.654321\tEnglish\tabor" +

"\n0\t00000\t0\t0.000000\tEnglish\tabor" +"\n";
Console.WriteLine(original);
string output = Regex.Replace(original,
"\n.*0\\.000000.*\n", "\n");
Console.WriteLine(output);
This works in .net 2.0 env, but not in 1.1 env. In 1.1, I have to
change it to
string output = Regex.Replace(original, ".*0\\.000000.*\n",
"");
It seems that Regex filter string line by line in 1.1.

Sep 13 '06 #1
0 905

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

Similar topics

1
1495
by: Adam Briska | last post by:
Given the script: -------- use strict; use warnings; my $text = 'blob:blob'; doit($text); doit($text);
2
2899
by: Dave | last post by:
I'm getting different results when I display a value in the Output window as opposed to the Immediate window. Why? Code to recreate problem: 'Purpose: Get different results from Output...
5
1157
by: Jeff Sandler | last post by:
I have a web page. It uses JavaScript to test the user's input before sending it to the server. It frequently tests using isNaN() with some very interesting results. The statements in question...
1
1001
by: Relishguy | last post by:
OK, so I am was never so good on NFAs and DFAs, but I am just trying to get one of the Microsoft-supplied RegEx samples to work. It is the last example (describing the Capture class) from this...
9
1704
by: Tamir Khason | last post by:
I have some string in variable str_tmp = "C:\TMP\" I want to display it in textbox (@-quoted), so I'm using tbx.Text = @str_tmp; but for some strange reason this does not work. it processes escape...
11
2898
by: HopfZ | last post by:
I coudn't understand some behavior of RegExp.test function. Example html code: ---------------- <html><head></head><body><script type="text/javascript"> var r = /^https?:\/\//g;...
15
50139
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
9
1503
by: Lie | last post by:
I've noticed some oddly inconsistent behavior with int and float: Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23) on linux2 -345 works, but Traceback (most recent call last): File...
4
1025
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, I would like to create a regular expression which matches "Y" or "male". The hard part is that the "Y" must be capital, but the "male" should be case insensitive. I think I have seen a way to...
0
7237
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
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7417
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
7506
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...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.