Simple regex - replace quote information in forum topic in C# -


It seems to me that should be very simple.

I have this string:

<<> [Quote = Joe Johnson 1] Hello! [/ Quote]

Who should be replaced by something

   

I think it's not going very well. So far I have this:

  Regex regexQuote = new Regex ("\ [citation \ = (. *?) \ | (. *?) \] (. *?) \ [\ / Quote]]);  

Can someone tell me in the right direction?

Appreciate any help!

Try it out:

  string pattern = @ "\ [citation = (. *?) \ | (\ D +) \] ([\ s \ S] *?) \ [/ Quote \] "; String replacement = @ "div class =" "quote" "> $ 3 
gt; & lt; a href =" "user / description / $ 2" "$ 1 & Lt; / a & gt; & lt; / div & gt; & lt; / div & gt; Console.printline (Regex. (Input, Pattern, Replacement));

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -