View Full Version : regular expresions?

01-08-2004, 07:44 AM
HI, I am wondering how u do regular expresions (like in js) in php, anybody got any guides...

specifically I have two questions for regular expresions:

how wold i make some thing that auto parses urls, like this forum does, so searches for a url in a string then makes it a link in html?

and how would I make the image feature like this forum. with the vBcode tag thing, that gets converted it to html

I want to add these 2 features to my guestbook message board thingie, and I don't know regular expresions, so i don't know how id do it. I do know how to do the simple replace function, but thats it.

01-08-2004, 09:07 AM
Searching the PHP forum for "bbcode" shows quite useful results: :)

01-08-2004, 09:04 PM
i found the page entitled "Pattern Syntax" (http://uk.php.net/manual/en/pcre.pattern.syntax.php) in the PHP manual taught me everything i needed to know, basically you use the functions on this page: http://uk2.php.net/manual/en/ref.pcre.php

01-08-2004, 09:31 PM
ah ha! thank you, exactly what I needed. I didn't think of searching for that, I did search for some other terms and didnt find any thing very useful.