473,324 Members | 2,531 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,324 software developers and data experts.

Replacing the specific pattern of text in a huge text string..

At run time I am building the HTML table as follows for literal control.

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here LIKE DATA 1
</span>

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here NNNN</span>

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here..</span>

...

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here5555</span>

......

In certain cases as part of business requirement I need to change the text
in between the strings as follows <span style='background-color:
#FFDD00'>Data Not Available</span> for all occurrence of starting string
"<span style='background-color: #FFDD00'>" and ending string "</span>".

How to write an efficient code for this? Instead of string manipulations I
would like to do use regular expressions for this.

Thanks for thinking to help me.

I am using .Net 1.1.

Smith
Nov 19 '05 #1
1 1119
I don't have a specific reg ex for you, but here is a great resource you
might want to know about if you don't already know about it:
http://www.regexlib.com/
-HTH

"Brown Smith" <BB********@hotmail.com> wrote in message
news:u3****************@TK2MSFTNGP10.phx.gbl...
At run time I am building the HTML table as follows for literal control.

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here LIKE DATA
1
</span>

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here NNNN</span>

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here..</span>

..

HTML Table related data ...

<span style='background-color: #FFDD00'>could be any data here5555</span>

.....

In certain cases as part of business requirement I need to change the text
in between the strings as follows <span style='background-color:
#FFDD00'>Data Not Available</span> for all occurrence of starting string
"<span style='background-color: #FFDD00'>" and ending string "</span>".

How to write an efficient code for this? Instead of string manipulations I
would like to do use regular expressions for this.

Thanks for thinking to help me.

I am using .Net 1.1.

Smith

Nov 19 '05 #2

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

Similar topics

3
by: Christopher R. Barry | last post by:
I need to search and replace multiple words in one pass of an input stream or string. For example, given the input: "The quick brown fox jumped over the lazy dog's back" and given the...
13
by: yaipa | last post by:
What would be the common sense way of finding a binary pattern in a ..bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the...
11
by: Dimitris Georgakopuolos | last post by:
Hello, I have a text file that I load up to a string. The text includes certain expression like {firstName} or {userName} that I want to match and then replace with a new expression. However,...
5
by: D | last post by:
hi there , i want to do something fairly simple (well it was simple in PERL) using the replace function of Regex... but i cannot find the docs to help me on it... i want to use a regex to find a...
17
by: J.S. | last post by:
I have a text file with parameters like the following embedded in the text: @@TextBox1@@, @@TextBox2@@, etc. I know how to read this text file. However, I am trying to figure out how to...
2
by: Tim_Mac | last post by:
hi, i have a tricky problem and my regex expertise has reached its limit. i have read other posts on this newsgroup that pull out the plain text from a html string, but that won't work for me...
14
by: Adnan Siddiqi | last post by:
Hi Suppose I have following URLs comming from an HTML document <a href="http://mydomain1.com">Domain1</a> <a...
4
by: wildman | last post by:
RE: Replacing Text without changing case?? This code works great, but case has to be exact. Research.Text = Research.Text.Replace(textboxSearch.Text, "<b>" + textboxSearch.Text + "</b>") ...
3
by: eBob.com | last post by:
Is there a regex pattern which will match a VB.Net string? I.E. a regex which matches ... "this is a ""vb.net"" string" (I don't want three matches in this case, I want one.) I've come up...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.