473,394 Members | 1,944 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,394 software developers and data experts.

Change Email

Hello,

I have a string that contains one or more email anchors as follows:

1. "this is a text <a title="Send Email"
href="mailto:ma**@mydomain.com">mail@mydomain</a>"

Or something like (In this case the anchor text is not the email
address):

2. "this is a text <a title="Send Email"
href="mailto:ma**@mydomain.com">Send Email</a>"

I need to do the following:
Replace all @ by // and . by / ... In the email address
If the anchor text is an email address replace it by Email and add
to the anchor the Css Class "LowReplace"
If the anchor text is not an email address then add to the anchor
the Css Class "Low"

Could someone help me doing this?

Thank You,
Miguel
Sep 18 '08 #1
2 1527
Regular Expressions are probably the way forward for this as you can do them
in C# on the server and in javascript on the client (although they differ
slightly). I am not a regular expressions wizard but there are plenty of
articles on them on the web. As for adding the css class, this is done
differently on the client to the server so you would need to provide more
information about where and when you are looking to do this.

HTH

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"shapper" wrote:
Hello,

I have a string that contains one or more email anchors as follows:

1. "this is a text <a title="Send Email"
href="mailto:ma**@mydomain.com">mail@mydomain</a>"

Or something like (In this case the anchor text is not the email
address):

2. "this is a text <a title="Send Email"
href="mailto:ma**@mydomain.com">Send Email</a>"

I need to do the following:
Replace all @ by // and . by / ... In the email address
If the anchor text is an email address replace it by Email and add
to the anchor the Css Class "LowReplace"
If the anchor text is not an email address then add to the anchor
the Css Class "Low"

Could someone help me doing this?

Thank You,
Miguel
Sep 18 '08 #2
On Sep 18, 10:42*am, Ciaran O''Donnell
<CiaranODonn...@discussions.microsoft.comwrote:
Regular Expressions are probably the way forward for this as you can do them
in C# on the server and in javascript on the client (although they differ
slightly). I am not a regular expressions wizard but there are plenty of
articles on them on the web. As for adding the css class, this is done
differently on the client to the server so you would need to provide more
information about where and when you are looking to do this.

HTH

--
Ciaran O''Donnellhttp://wannabedeveloper.spaces.live.com

"shapper" wrote:
Hello,
I have a string that contains one or more email anchors as follows:
1. "this is a text <a title="Send Email"
href="mailto:m...@mydomain.com">mail@mydomain</a>"
Or something like (In this case the anchor text is not the email
address):
2. "this is a text <a title="Send Email"
href="mailto:m...@mydomain.com">Send Email</a>"
I need to do the following:
* Replace all @ by // and . by / ... In the email address
* If the anchor text is an email address replace it by Email and add
to the anchor the Css Class "LowReplace"
* If the anchor text is not an email address then add to the anchor
the Css Class "Low"
Could someone help me doing this?
Thank You,
Miguel
I have this covered on the client ... it is working. The problem now
is on the server in C#
Sep 18 '08 #3

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

Similar topics

5
by: Stewart Midwinter | last post by:
I've got an app that creates an object in its main class (it also creates a GUI). My problem is that I need to pass this object, a list, to a dialog that is implemented as a second class. I want...
3
by: zerdust | last post by:
how can I change the name of XML node? this is sample <?xml version="1.0"?> <adresboek> <adres> <naam>Mark van Renswoude</naam> <straat>ddden 24</straat> <plaats>Scddd</plaats>...
4
by: argniw | last post by:
I have a number of OBDC connections to SQL server tables in my access database. I want to change the data source for each of the links at once. With the linked table manager you can only change...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
0
by: Scott Abel | last post by:
Tuesday, December 12, 2006 -- 10:00AM EST / 3:00 PM GMT X-Pubs presents: CMS & Change - Love it, Hate it, Master it (Scott Abel & Emma Hamer) Reserve your Webinar seat now at:...
7
by: moondaddy | last post by:
in asp.net 2.0, i have a link buttonand want to change the forecolor in a mouse over event. how can I do this? -- moondaddy@noemail.noemail
7
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
I want to change the font color and weight at a specific position in the text. I am not sure where or what I need to do. It will be at position 155/156 from the left on each line. Here is the...
2
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?...
4
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
6
by: gavy7210 | last post by:
hello i am using struts 1.2,Eclipse Platform Version: 3.4.2,mySql 5.0.1,jdk 1.5.. i have a login form(jsp) in which a user logs in,in case he doesnt enter his username and/or password an error...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.