[thelist] regular expression help

Max Schwanekamp lists at neptunewebworks.com
Sun Apr 1 14:48:06 CDT 2007

Bob Meetin wrote:
> I'm back... I tested and can't seem to get it to work, so I created a 
> test page in PHP.  The page is at www.dottedi.biz/codesamples/regex.php. 
> On the page I display the code in plain text, then have a section to 
> display the output.  I made up some dummy contents for the variable, 
> $data. 
> What this is for - I have some content management pages where clients 
> can update some of their own content.  I'm trying to make it a little 
> easier for them to do a few very simple functions such as include a URL 
> without having to know HTML.  This is similar in concept to some of the 
> bbcode stuff I've seen on a few message boards. 

Hi Bob, not sure if it meeds your needs or not, but you might take a 
look at textile[0], markdown[1], or similar.  You can pretty easily 
present the syntax in tiers of complexity.  The 37Signals people use it 
to reasonably good effect in Basecamp.  The nice thing is that the basic 
formatting is pretty straightforward (two newlines mean new paragraph, 
*text* becomes bold, bullet lists, urls become links, etc), complex 
formatting is possible with slightly more complex syntax, and then those 
who know it can just use HTML, or a combination of text formatting and html.

[0] http://en.wikipedia.org/wiki/Textile_(markup_language)
[1] http://www.michelf.com/projects/php-markdown/

Max Schwanekamp

More information about the thelist mailing list