Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » html » bbCode
  • Convert BBCode, [color] tags, to HTML

    Greetings.  I have some problems using a Regex replace for converting the following BBCode: string bbCode = " [ color=red]Red[/color]"; Regex regExp = new Regex(@"\[ color=([^\]]+)\]([^\]]+)\[\/color\]"); string htmlCode = regExp.Replace(bbCode, "<span style=\'color: $1\'>$2</span>'); Essentially, ...
    Posted to Construction Advice (Forum) by Bassiq on April 7, 2008
  • How to replace only outer matching one?

    Hi!  I need to write a regular expression code to replace only the outer occurance of a string  with some other string say <aaaaaaaaaaaaaa>------ </aaaaaaaaaaaaaa> Sample: &nbsp;function sayHello($msg) { &nbsp;&nbsp; print $msg; } &nbsp; &nbsp;&nbsp;&nbsp; function bye() &nbsp;&nbsp; ...
    Posted to Construction Advice (Forum) by anvar on December 20, 2006