Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

need regular expression

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
CNTITDEPT
Asked:
CNTITDEPT
  • 2
  • 2
1 Solution
 
ThogekCommented:
Perhaps something along the lines of:

    System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(">.*<");
    string strChanged = Regex.Replace(strOriginal, "> <");
0
 
CNTITDEPTAuthor Commented:
Thogek:

That does not work, it does not find any matches
0
 
CNTITDEPTAuthor Commented:
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
 
ThogekCommented:
Doh.  Sorry 'bout that.  But at least you figured it out.  :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now