Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

need regular expression

Posted on 2004-08-02
4
Medium Priority
?
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Thogek earned 250 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

609 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