- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Pattern Title
easy when you want to allow your users to post images, but in a controlled way. I used it like this (in php): $text = preg_replace("/(\[IMG\])(\S+?)(\[\/IMG\])/is", "<a href=\"\\2\" target=\"_blank\"><IMG SRC=\"\\2\" align=\"center\" height=\"100\" border=\"0\"></a>",$text); so whenever they use [img][/img] it will be converted to <a href="" target="_blank"><IMG SRC="" align="center" height="100" border="0"></a> so you get a 100 pixels high picture, and when they click on it it opens in a new window... (to prevent users from posting huge pictures and stuff)
[IMG]http://bleh.jpg[/IMG] | [ImG]bleh[/imG] | [img]ftp://login:pass@bleh.gif[/img]
<img src="bleh.jpg">
Author Rating: The rating for this expression. marnik vander elst
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2018, | ASP.NET Tutorials