Rookie problem: regular expressions find and replace strings with spaces

I have the following string:

<some texts hier>

<br>

you can see that its format is wrong.

I want to use a regular expression to find the space in the angle brackets and replace it with the angle brackets. The desired output is

<font color="blue">some texts hier</font>

<br>

I have tried many methods myself, such as < (. *?\ w) > , but the results are always wrong.

rookie problem. Thank you for your help!


clipboard.png

try this regular


    //source
    public string RegexShow(string source)
    {
        source = "

><<>sadas

"; Regex Reg = new Regex(@"(?is)(?<=<P>).*?(?=</P>)", RegexOptions.IgnoreCase); //

var Content = Reg.Match(source).Value; Content = Regex.Replace(Content, "[<>]", "", RegexOptions.IgnoreCase); //<> return Content; }

your question itself is a bit contradictory.
if

< some texts hier >


'some texts hier' can be replaced, then ' p > < some texts hier > < / p' this paragraph can also be replaced. You should change your way of thinking, first take out the content of the p element, then remove the angle brackets from the content, and then assign the value to the p tag.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7c12e6-1df4e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7c12e6-1df4e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?