Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expression, UBB Code, and Matching Problems

Status
Not open for further replies.

danielhai

Programmer
Oct 23, 2001
25
0
0
US
Hi, I'm trying to mimic the TGML code on here or in UBB -- but I'm having a problem with Regular Expressions matching too much, I thought that the engine would find the first match of an occurence and match it, however it's going to the end of the string .+ and doing the replace there. For example:

I want to take string:
Code:
[url=http://www.tek-tips][img]imgsrc[/img][/url]

[url=http://www.tek-tips][img]imgsrc[/img][/url]

[url=http://www.tek-tips][img]imgsrc[/img][/url]
and have it match with:

REReplaceNoCase(string, "\*)\](.*)\[/url\]","<a href=""\1"" target=""_blank"" class=""underline"">\2</a>","ALL")

However, it is matching the ENTIRE string, rather then matching 3 times seperately. Any help? I've tried:

\[url=(^\]*)\][^[\[/url\]]*\[/url\]

as well, but it doesn't seem to like grouped strings ... Using Coldfusion MX 7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top