Change Email

S

shapper

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:[email protected]">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:[email protected]">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
 
C

Ciaran O''Donnell

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
 
S

shapper

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

I have this covered on the client ... it is working. The problem now
is on the server in C#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top