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

Browse by Tags

All Tags » bbCode
  • BBCode --> HTML table

    Hello I have a forum that allows custom bulletin board code to be executed through PHP files. Now I'm trying to construct a html table tag from some kind of 'template'. A pipe symbol designates the delimiter between individual cells of the table and a linebreak designates that a new table row should be inserted. Ofcourse, there is no ...
    Posted to Construction Advice (Forum) by Vince0789 on May 13, 2011
  • preg_replace of http adresses

    hi im using PHP and i got this function in my forumsoftware:   function links($text, $conf) { $text = preg_replace("/(\s)http:\/\/([\S]+?)(\s)/i" , "$1http://$2$3" , " $text "); $text = ...
    Posted to Construction Advice (Forum) by hayopai on February 17, 2011
  • find if either stringa or stringb do not exist in a string

    I am working on making a bbcode system with php using preg_replace(), and I am making it so that other tags will not work inside of a code block. This is the code I am currently using, it almost works: /(?!\[code\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?<!\[\/code\])/Usi  what I want it to do is if [*code] and [*/code] are around the text inside, ...
    Posted to Construction Advice (Forum) by sarathi on July 31, 2009
  • [quote] forum's tags stripping recursively

    Hello All. you know there are many forums using a quote bb code like this [q uote] some quote [/q uote] I know how to match it but the problem is it can be nested and I do not know how to match it recursively. some text [q uote] some quote [q uote] some nested quote [/q uote] some [q uote] some nested quote [/q uote] quote [/q uote] some ...
    Posted to Construction Advice (Forum) by imei on September 7, 2008
  • BBCode conversion

    Hi, I asking for help in my PHP code optimization. I try to rewrite my old/slow BBCode conversion function to use regex. The allowed BBCodes are [ b]text[ /b] [ i]text[ /i] [ url]domain.com[ /url] or [ url]domain.com|domainname[ /url] [ img]filename.ext[ /img] or [ img]filename.ext|description[ /img] It is possible to construct ...
    Posted to Construction Advice (Forum) by pandor on August 23, 2008
  • 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
  • BBcode advanced url tags

    Hello!  Please forgive in advance, my english is not too well. [:'(].  I am creating a content system in PHP.  I want to make advanced "url" tags and I am at a loss. I understand the basic {gopage=home disp=Home} but some of my urls will not always have just that.  Some I need to have class and subpage.  Is ...
    Posted to Construction Advice (Forum) by millerd87 on December 28, 2006
  • 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
  • Advanced Regular expression for bbCode

    I have a regexp who finds a blocks of bbCode. #\\[(b|u|i|code|color|anothertag|anothertag2|etc)(\s=?.+?|=.+?|)] ( (?: (?R) | (?:.*?(?!\\\[/\\1])) )* ) \\[/\\1]#x for example [ b ]sfsf[ u ]sddgdg[ /u ]dfgdfg[ /b ] It works on pcre 6.2 very well but if i run it on pcre 6.7(php 5.2) and use text like this [ b ]sdfsdf[ i ]dgdfg[ /b ]dfgdg[ /i ...
    Posted to Construction Advice (Forum) by Hellson on December 12, 2006