Solved

need regular expression

Posted on 2004-08-02
4
197 Views
Last Modified: 2010-04-15
I suck at need regular expressions, can some one write one for me to:


I need a need regular expression to replace all charecters between > and < with a blank space.

example:    hi this is a sentence la la la >replace all this with a blank space< ok now onto writing more

Thanks,
Ed
0
Comment
Question by:CNTITDEPT
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Thogek earned 125 total points
ID: 11695700
Perhaps something along the lines of:

    System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(">.*<");
    string strChanged = Regex.Replace(strOriginal, "> <");
0
 
LVL 1

Author Comment

by:CNTITDEPT
ID: 11696100
Thogek:

That does not work, it does not find any matches
0
 
LVL 1

Author Comment

by:CNTITDEPT
ID: 11696600
Thogek:
One mistake in your code:

string strChanged = Regex.Replace(strOriginal, "> <");

should be:

string strChanged = reg.Replace(strOriginal, "> <");

Your way did not work untill I put it into a foreach statement, So now it does the job

Thanks,
Ed
0
 
LVL 15

Expert Comment

by:Thogek
ID: 11696635
Doh.  Sorry 'bout that.  But at least you figured it out.  :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question