View Single Post
Old 04-11-2008, 01:22 AM   #26 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default

Code:
$pattern[0] = "/\[b\](.*?)\[\/b\]/i";
Ain't good enough :)

What If I wanted to hmm check the bold tag like this:

Code:
[ b]
test
[/b ]
That little regex wouldn't check it it'll display it like it is.

Thats why you use the "s" modifier :) to make the "." match new lines also :)

Code:
$pattern[0] = "/\[b\](.*?)\[\/b\]/is";
Now
Code:
[b ]
test
[/b ]
Turns into

Code:
<strong>
test
</strong>
I taught my self something :)

(remove the spaces in the [ b] tags -.-.. stupid code tag is broke lol..)
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote