makeshift_theory Posted January 21, 2007 Share Posted January 21, 2007 Okay I'm trying to detect the tag [s id=image.gif] and change it to <img src="image.gif"> here is the code:[code] $sbegin = '/(\[s id=)(.*)(\])/'; $slink = '<img src="${2}">';[/code]When it runs it is picking up the closing bracket of [s id=image.gif] any advice? Quote Link to comment Share on other sites More sharing options...
effigy Posted January 22, 2007 Share Posted January 22, 2007 What do you mean by picking up? It works OK for me. You can change[tt] (.*) [/tt]to[tt] ([^]]*)[/tt]to be more precise. Also, why bother capturing what you don't need? Quote Link to comment Share on other sites More sharing options...
makeshift_theory Posted January 22, 2007 Author Share Posted January 22, 2007 I switched from using that method to the smilie method. I had to take that tag and convert it BBCODE style. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.